Standard built-ins
String.prototype.charCodeAt()
Returns the numeric value of the UTF-16 unit at an index; invalid bounds yield NaN.
Formal Syntax & Structure
javascript syntaxjavascript
text.charCodeAt(index)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| index | Number | Index converted to an integer. |
Return Value
Number
Unit value 0–65535 or NaN.
Working Example
Example Snippetjavascript
console.log("A".charCodeAt(0));