Easy Tutorial
❮ Prop Style Boxshadow Prop Style Fontsizeadjust ❯

JavaScript charAt() Method

JavaScript String Object

Example

Returns the third character in the string:

n Output:


Definition and Usage

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

The first character is at position 0, the second character is at position 1, and so on.


Browser Support

All major browsers support the charAt() method.


Syntax

Parameter Values

Parameter Description
index Required. A number representing a position in the string, i.e., the position of the character in the string.

Return Value

Type Description
String Returns the character at the specified position.

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


More Examples

Example

Returns the last character in the string:

n Return Value:


JavaScript String Object

❮ Prop Style Boxshadow Prop Style Fontsizeadjust ❯