domenic at domenicdenicola.com (2013-10-24T14:17:21.762Z)
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.
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/