DEV Community

Discussion on: Converting UTF (including emoji) to HTML

Collapse
 
nikkimk profile image
Nikki Massaro Kauffman • Edited

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!