Standard built-ins
String.prototype.charAt()
Reads a unit at a nonnegative integer index; out of range yields the empty string.
Formal Syntax & Structure
javascript syntaxjavascript
text.charAt(index)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| index | Number | Index converted to an integer. |
Return Value
String
One unit or empty string.
Working Example
Example Snippetjavascript
console.log("abc".charAt(1));