On Thu, May 17, 2018 at 4:24 PM, kdex <k...@kdex.de> wrote:
> This idea comes from a rather ASCII-centric perspective upon strings and
will
> definitely break multi-byte characters.

No. One of the improvements to JavaScript since ES5 (you know, those things
you keep objecting to) is that strings are now iterable, and the iteration
visits *characters* (codepoints), not code units. (Example:
https://jsfiddle.net/03tLpbrv/) (Also worth noting that JavaScript strings
were never ASCII-centric. They were UTF16-centric [with invalid surrogate
pairs tolerance].)

If there were a `.map` added, it would presumably visit characters, not
code units, as well; it would be the only reasonable thing to do, both in
light of how strings iterate and just general utility/appropriateness.

-- T.J. Crowder
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to