ES6 fixes `String.fromCharCode` by introducing `String.fromCodePoint`.
Similarly, `String.prototype.charCodeAt` is fixed by
`String.prototype.codePointAt`.
Should there be a method that is like `String.prototype.charAt` except it deals
with astral Unicode symbols wherever possible?
>> '๐'.charAt(0) // U+1D306
'\uD834' // the first surrogate half for U+1D306
>> '๐'.symbolAt(0) // U+1D306
'๐' // U+1D306
Has this been discussed before? If thereโs any interest Iโd be happy to create
a strawman.
Mathias
http://mathiasbynens.be/
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss