This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

charCodeAt

Summary

Returns the Unicode value of the character at the specified location.

Syntax

strObj. charCodeAt( index )
strObj
Required. Any String object or string literal.
index
Required. The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.

Examples

The following example illustrates the use of the charCodeAt method.

var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 document.write(str.charCodeAt(str.length - 1));

 // Output: 90

See also

Other articles

Attributions

  • Microsoft Developer Network: Article