DEV Community

Md Shah Jalal
Md Shah Jalal

Posted on

JavaScript String CharAt() methods

CharAt(): The charAt() method returns the character at a specified position in a string.

Syntax:
string.charAt(index)

Example:

let text = “Charecter”;
text.charAt(0);
Enter fullscreen mode Exit fullscreen mode

The output will be “C”

And again

text.charAt(3);
Enter fullscreen mode Exit fullscreen mode

The output will be “r”

Top comments (0)