Standard built-ins
String length
The length property of a string value counts its UTF-16 code units. Surrogate pairs occupy two units and grapheme clusters may span more. The property does not count UTF-8 bytes or visible characters.
Formal Syntax & Structure
javascript syntaxjavascript
text.lengthReturn Value
number
Nonnegative number of UTF-16 code units.
Working Example
Example Snippetjavascript
console.log("A😀".length);