String.prototype.charAt()
String.prototype.charAt() is a JavaScript method in the String category. Returns the character at the specified index. The syntax is str.charAt(index). It returns A single character string. A typical example: "hello".charAt(1) // "e". Its time complexity is O(1), which matters when it runs over large inputs. The TypeScript signature is (index: number): string. A close sibling is String.prototype.charCodeAt(), which returns the Unicode value of the character at the specified index. A close sibling is String.prototype.concat(), which concatenates strings together. A close sibling is String.prototype.includes(), which checks if a string contains a specified substring. A close sibling is String.prototype.indexOf(), which returns the index of the first occurrence of a specified value. More about this category: String methods for text manipulation — split, replace, trim, match, and more. Related String methods: String.prototype.charCodeAt(), String.prototype.concat(), String.prototype.includes(), String.prototype.indexOf(), String.prototype.lastIndexOf(), String.prototype.match(), String.prototype.matchAll(), String.prototype.replace(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls.