Thanks for the reply! It looks like there are limitations on how the character is passed to the function and used in the spread operator. I corrected my original post. Also I wasn't aware of String.prototype.codePointAt.
I guess the only limitation with either of our approaches is support of IE11, since neither String.prototype.codePointAt nor the spread operator would work.
So for IE11, we'd need toString.prototype.charCodeAt, but we'd probably have to test with something like !!char[1].
Thad, said, I'm probably going to switch to String.prototype.codePointAt in my original use case, so again, thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the reply! It looks like there are limitations on how the character is passed to the function and used in the spread operator. I corrected my original post. Also I wasn't aware of
String.prototype.codePointAt
.I guess the only limitation with either of our approaches is support of IE11, since neither
String.prototype.codePointAt
nor the spread operator would work.So for IE11, we'd need to
String.prototype.charCodeAt
, but we'd probably have to test with something like!!char[1]
.Thad, said, I'm probably going to switch to
String.prototype.codePointAt
in my original use case, so again, thanks!