Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)



If 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/Refe...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: