Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Yeah this one is also good but then I had to explain this also and i am trying to show everything as a beginners perspective so later they can simplify the code on their own and come with these type of one liner solutions 😉
Also I want to explain join and split in a separate posts that's why I didn't explained much about them in this blog 😂😂
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
reverseStr('😁hi😅hello')// 'olleh😅ih😁'reverseStr('😁привет')// 'тевирп😁'reverseStr('吾輩は猫である🐱')// '🐱るあで猫は輩吾'reverseStr('😮💨')// '💨😮' <-- this is a ZWJ Sequence working properly// You can also set the `u` flag for Unicode codepoints like that:"😄😄".split(/(?:)/u);// [ "😄", "😄" ]
but this won't work for someZWJ Sequences (multiple emojis joined with a zero-width joiner character being displayed as a "single emoji") and I was wondering why.
reverseStr('🧑🏻💻')// '💻🏻🧑' <-- this is a ZWJ Sequence working 'wrong'
Actually it's doing "great" reversing the whole thing as it did with
reverseStr('😮💨')// '💨😮'
The issue I think is that the "computer" can't be joined with the "skin tone" and we see this weird symbol because skin tone does not work standalone.
Also I noticed that destructuring has issues with words in hindi as well:
[...'हाय आप कैसे है'].reverse().join()// 'ै,ह, ,े,स,ै,क, ,प,आ, ,य,ा,ह'
Thus it actually works "fine", or as intended from the computation point of view, it's just that we don't have a valid "translation" to show the result, let's say computer ‍ skin-tone-medium ‍ human and something similar should be happening with hindi words (and presumably other languages).
Whenever you need to work with ZWJ Sequences or some specific languages, Intl.segmenter is the option because it simply doesn't break those joined unicodes into something "unreadable". And to be precise it doesn't reverse the icons.
If the standard covered symbols to be directional let's say "faceairBlow"😮💨 and then "airBlowface" being the opposite (blowing to the left) and also joining the modifiers to the compatible icons (either be right or left), every emoji sequence could be effectively reversed without breaking the "emoji" render.
On the other hand I can't understand -yet- why Firefox is not supporting it, I'll search to see if I can find the reason somewhere.
Do you guys have more detail on that?
Edit: I get some info about it here if you want to check. TL;DR It will be supported in short (theoretically).
Say no more:
😂😂
I'm loving this posts you do on your learning, following up to read more 😁
Yeah this one is also good but then I had to explain this also and i am trying to show everything as a beginners perspective so later they can simplify the code on their own and come with these type of one liner solutions 😉
Also I want to explain join and split in a separate posts that's why I didn't explained much about them in this blog 😂😂
seen 1000 times and wrong 1000 times...
Yes yees we know, that doesn't mean it's wrong. You don't need to deal with emojist most of the time and when you do, simply
There are multiple ways to deal with that 🤷🏻♀️
the only correct way: Intl.Segmenter!!
it's not about emojis, it's plain and simple also about characters in other languages…
dev.to/lukeshiru/comment/20d68
Intl.Segmenter is not working with Firefox
use a polyfilll
So I tried to break this down a bit
but this won't work for some ZWJ Sequences (multiple emojis joined with a zero-width joiner character being displayed as a "single emoji") and I was wondering why.
If we look at the Unicode Technical Standard, @lukeshiru you pick the emoji wisely to showcase.
Actually it's doing "great" reversing the whole thing as it did with
The issue I think is that the "computer" can't be joined with the "skin tone" and we see this weird symbol because skin tone does not work standalone.
Also I noticed that destructuring has issues with words in hindi as well:
Thus it actually works "fine", or as intended from the computation point of view, it's just that we don't have a valid "translation" to show the result, let's say
computer ‍ skin-tone-medium ‍ human
and something similar should be happening with hindi words (and presumably other languages).Whenever you need to work with ZWJ Sequences or some specific languages,
Intl.segmenter
is the option because it simply doesn't break those joined unicodes into something "unreadable". And to be precise it doesn't reverse the icons.If the standard covered symbols to be directional let's say "faceairBlow"😮💨 and then "airBlowface" being the opposite (blowing to the left) and also joining the modifiers to the compatible icons (either be right or left), every emoji sequence could be effectively reversed without breaking the "emoji" render.
On the other hand I can't understand -yet- why Firefox is not supporting it, I'll search to see if I can find the reason somewhere.
Do you guys have more detail on that?
Edit: I get some info about it here if you want to check. TL;DR It will be supported in short (theoretically).
this goes directly above my head 😂😂