RangeError: argument is not a valid code point
ë©ìì§
RangeError: {0} is not a valid code point (Firefox)
RangeError: Invalid code point {0} (Chrome)
ìë¬ íì
RangeError
무ìì´ ì못ëììê¹?
String.fromCodePoint() ë©ìëë ì í¨í ì½ë í¬ì¸í¸(code point)ë§ì ë°ìë¤ì
ëë¤.
code pointë ì ëì½ëì ì½ë ì¤íì´ì¤ ê°ì¼ë¡, 0ë¶í° 0x10FFFFê¹ì§ì ì ì ë²ìì
ëë¤.
NaNì ì¬ì©íë ê°, ìì (-1), ì ìê° ìë ì(3.14), ëë 0x10FFFF (1114111) ë³´ë¤ í° ê°ì ì´ í¨ìì ì ì©ë ì ììµëë¤.
ì
>ì í¨íì§ ìì ê²½ì°
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
ì í¨í ê²½ì°
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"