getting a string length that contains unicode character exceeding 0xffff
04:24 18 Jul 2018

I’m using this character, double sharp '𝄪' which unicode is 0x1d12a.
If I use it in a string, I can’t get the correct string length:

str = "F𝄪"
str.length // returns 3, even though there are 2 characters!

How do I get the function to return the correct answer, whether or not I’m using special unicode or not ?

javascript unicode