[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint [Back]  [Original]

String.fromCodePoint() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

String.fromCodePoint()

Baseline

20159

String.fromCodePoint()

console.log(String.fromCodePoint(9731, 9733, 9842, 0x2f804));
// : ""

js
String.fromCodePoint()
String.fromCodePoint(num1)
String.fromCodePoint(num1, num2)
String.fromCodePoint(num1, num2, /* , */ numN)

num1, , numN

0 0x10FFFF Unicode

RangeError

numN 0 0x10FFFF

fromCodePoint() String String String.fromCodePoint()

Unicode 0 1114111 (0x10FFFF) charAt() 65536 16 fromCodePoint() UTF-16 length Unicode UTF-16 Unicode

fromCodePoint()

:

js
String.fromCodePoint(42); // "*"
String.fromCodePoint(65, 90); // "AZ"
String.fromCodePoint(0x404); // "\u0404" === ""
String.fromCodePoint(0x2f804); // "\uD87E\uDC04"
String.fromCodePoint(194564); // "\uD87E\uDC04"
String.fromCodePoint(0x1d306, 0x61, 0x1d307); // "\uD834\uDF06a\uD834\uDF07"

:

js
String.fromCodePoint("_"); // RangeError
String.fromCodePoint(Infinity); // RangeError
String.fromCodePoint(-1); // RangeError
String.fromCodePoint(3.14); // RangeError
String.fromCodePoint(3e-2); // RangeError
String.fromCodePoint(NaN); // RangeError

fromCharCode()

String.fromCharCode() 0x010000 0x10FFFF UTF-16

js
String.fromCharCode(0xd83c, 0xdf03); // Code Point U+1F303 "Night with
String.fromCharCode(55356, 57091); // Stars" === "\uD83C\uDF03"

String.fromCodePoint() UTF-32 4 2 BMP

js
String.fromCodePoint(0x1f303); //  10  127747

ECMAScript 2027 LanguageSpecification
# sec-string.fromcodepoint


Web Proxy Viewer  |  New URL  |  Original Page