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

Reply via email to