charCodeAt

Returns a number indicating the ISO-Latin-1 codeset value of the character at the given index.

Applies to

String

Syntax

charCodeAt(index)

Parameters

index

(Optional) An integer between 0 and 1 less than the length of the string. The default value is 0.

Description

The ISO-Latin-1 codeset ranges from 0 to 255. The first 0 to 127 are a direct match of the ASCII character set.

Example

The following example returns 65, the ISO-Latin-1 codeset value for A.

"ABC".charCodeAt(0)