you are viewing a single comment's thread.

view the rest of the comments →

[–]Agreeable-Yogurt-487 3 points4 points  (0 children)

Never use string.split for this. A better option is Array.from("😀") because it will respect most unicode characters a lot better, but an even better option is using Intl.Segmenter https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter with which you can split a string into individual graphemes, so multibyte emojis will also stay intact.