Search⌘ K
AI Features

Accessing Characters inside a String

Explore how to access individual characters in JavaScript strings using bracket notation and the charAt method. Understand that strings are immutable, meaning their characters cannot be changed directly. Learn iteration techniques over strings with various JavaScript loops to manipulate and read string data effectively.

We'll cover the following...

The bracket notation

The bracket notation, also used with arrays, can provide access to an arbitrary character in a string:

Node.js
let digits = '0123456789';
console.log(digits[4]);

The charAt

...