Frequently asked questions
›Why does "👍🏽".length return 4 in JavaScript?
length counts UTF-16 code units. The thumbs-up and the skin-tone modifier are two code points outside the basic plane, and each needs two units. Users see a single character (a grapheme).
›What are invisible characters and why do they matter?
Zero-width spaces, joiners, the BOM or bidirectional controls take no space on screen but break string comparisons, passwords, slugs and JSON parsing, and can be used to disguise file names.
›Which escape should I use?
\u00E9 or \u{1F600} in JavaScript strings, é in HTML and \E9 in CSS content. The table shows all of them for every character.