JS: String.prototype.codePointAt

By Xah Lee. Date: . Last updated: .

(new in JS: ECMAScript 2015)

str.codePointAt(index)

Return a integer that's the Codepoint of character at position index of str.

console.log("abc".codePointAt(0) === 97);
// true
console.log("😂".codePointAt(0) === 128514);

/*
😂
name: FACE WITH TEARS OF JOY
codepoint 128514
codepoint hexadecimal 1f602
*/

See also: Unicode Search 😄

JavaScript. String, Char, Encoding, Hexadecimal

JS String.prototype