Why an emoji can have two different character totals
Example input
Hi 😀Expected result
words: 1
characters: 4
graphemes: 4
UTF-16: 5Paste the sample including the space. The two letters, space and emoji make four Unicode code points. JavaScript represents this emoji with two UTF-16 code units, so its string length is five. A word processor or publishing system can use yet another counting convention; check its own result before submitting a strict limit.