JavaScriptStringcharAt

charAtString

charCodeAt

Returns the character at the specified index.

Syntax

str.charAt(index)

Example

Enter values below to update the example in real time.

const
greeting
console
charAt
const greeting = "Hello, World!";
console.log(greeting.charAt(0));   // "H"
console.log(greeting.charAt(7));   // "W"