JavaScript
Result
Run
License
var str = "\uD800\uDC00"; var str2 = "Hello"; // 문자의 위치가 0인 유니코드의 코드 포인트 값을 나타내는 숫자 반환 var codePoint = str.codePointAt(0); var charCode = str.charCodeAt(0); console.log(`-- str: \uD800\uDC00 -----`); console.log(`The '${str}' character code point ${codePoint} is different to ${charCode} of charCodeAt()`); codePoint = str2.codePointAt(0); charCode = str2.charCodeAt(0) console.log(`-- str2 : Hello -----`); console.log(`The '${str2}' character code point ${codePoint} is same to ${charCode} of charCodeAt()`); window.addEventListener("DOMContentLoaded", () => { document.body.textContent = `str: ${str}, str2: ${str2}`; });
Console
expand_less
License
License
by DevDic
Close