--

str.split('') is a very 90s way to write JS these days:

* all emoji are broken

* all codepoints too

[...str] is the builtin way to deal with more complex than utf-16 chars in JS, and I honestly urge any modern article around strings manipulation to use that, otherwise every non latin based programmer will break their code. Thanks for considering this update.

--

--

Andrea Giammarchi
Andrea Giammarchi

Written by Andrea Giammarchi

Web, Mobile, IoT, and all JS things since 00's. Formerly JS engineer at @nokia, @facebook, @twitter.

Responses (1)