string.codePointAt
codePointAt() method๋ Unicode code point์์๊ฐ ์๋ ์ ์๋ฅผ ๋ฆฌํดํ๋ค.
const icons = 'โโ
โฒ';
console.log(icons.codePointAt(1)); // 9733Syntax
str.codePointAt(pos)Parameters
pos
code point ๊ฐ์ผ๋ก ๋ฐํํ String ์์์ ์์น
Return value
์ฃผ์ด์ง index์ code point ๊ฐ์ ๋ฌธ์๋ฅผ ๋ํ๋ด๋ ์ซ์,
index์์น์ element๊ฐ ์์ ๊ฒฝ์ฐ undefined
Description
index์์ surrogate pair์ด ์์๋์ง ์์ผ๋ฉด index ์์น์ ์๋ code unit์ return ํ๋ค.
Examples
Using codePointAt()
Polyfill
Last updated
Was this helpful?