> Le 17 mars 2018 à 19:29, Oriol _ <oriol-bugzi...@hotmail.com> a écrit : > > Be aware your code breaks pair surrogates, which might be undesirable: > > ```js > var str = "a_\uD83D\uDE80_b"; > str.split("").reverse().join(""); // "b_\uDE80\uD83D_a" :( > [...str].reverse().join(""); // "b_\uD83D\uDE80_a" :) > ``` > > —Oriol
Well, but be aware that the corrected implementation still breaks graphemes composed by a sequence of code points, such as: n̈ ( LATIN SMALL LETTER N + COMBINING DIEARESIS), which might be undesirable... Anyway, what are the use cases? —Claude
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss