The problem is that the String.fromCharCode()
method return an incorrect match (or has some limitation (not sure which exactly)
I have tried some of the char codes from here.
And all of the items under 12953
are working fine. But if you try anything, starting from 126980
it stops working and displays
.
However, if I try checking it here, it finds it.
Is it because something is missing? or it could be because of "surrogate pair"(the characters that have more than one code unit)?
By running the following lines of code:
const emojis = [12953, 126980]; // ㊙,
console.log(String.fromCharCode(emojis[0])); // displayed correctly as it is ㊙
console.log(String.fromCharCode(emojis[1])); // is dispalyed instead of