String Length

noun

say it: “STRING LENGKTH” /strɪŋ lɛŋkθ/

How many characters a string holds, read with .length, so "latte".length is 5. Most characters count as 1, but some emoji count as 2.

What is String Length in JavaScript?

String Length — The number of UTF-16 code units in a String.

const city = "Denver";
const characterCount = city.length;
const firstCharacter = city[0];

In a sentence

  • “I checked the string length of each drink name so it fits on the menu board.”

Level: Apprentice · More JavaScript terms at this level

Updated

In other subjects