2 ms·
The .iterator() method of strings in JS returns code points, not JS characters, so, e.g., Array.from("a") is ["", "a"]. (I use U+1F4A9 for testing all my non-B
by jcranmer 10y ago
The .iterator() method of strings in JS returns code points, not JS characters, so, e.g., Array.from("a") is ["", "a"].
(I use U+1F4A9 for testing all my non-BMP needs)
- deathanatos 10y agoIf I've got the right method[1], that appears to have been added in ES6. I'm still getting up to speed there. Not supported on IE, of course. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/@@iterator https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...