Standard built-ins
String.prototype.codePointAt()
Returns the code point starting at the index, combining a valid leading/trailing surrogate pair. A lone or trailing surrogate is returned as its unit number.
Formal Syntax & Structure
javascript syntaxjavascript
text.codePointAt(index)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| index | Number | Index converted to an integer. |
Return Value
Number | undefined
Code point number or undefined.
Working Example
Example Snippetjavascript
console.log("😀".codePointAt(0));