Skip to content

Characters in a string

Read · 1 of 3

A string is a row of characters

s.length is how many characters there are, and s[i] is the character at position i, starting from 0. A character is just a string of length 1.

for (const c of s) visits each character in order.