String Index

noun

say it: “STRING IN-deks” /strɪŋ ˈɪndɛks/

The number that says where a character sits in a JavaScript string, counting from 0, so in 'Mochi' the M is at index 0 and the i is at index 4.

What is String Index in JavaScript?

String Index — A zero-based position used to locate a character in a String.

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

In a sentence

  • “name[0] read the character at index 0, the first letter, so I could show it in a round badge.”

Level: Apprentice · More JavaScript terms at this level

Updated

In other subjects