SyntaxError: "x" is a reserved identifier
ë©ì¸ì§
SyntaxError: The use of a future reserved word for an identifier is invalid (Edge)
SyntaxError: "x" is a reserved identifier (Firefox)
SyntaxError: Unexpected reserved word (Chrome)
ìë¬ íì
SyntaxError
무ìì´ ì못ëììê¹?
ìì½ì´ê° ìë³ìë¡ ì°ì¸ ê²½ì° ë°ìíë ìë¬ì ëë¤. ì´ í¤ìëë ì격(Strict) 모ëì ëì¨í(Sloppy) 모ëìì 모ë ìì½ì´ë¡ ì·¨ê¸ë©ëë¤.
enum
ë¤ìì ì격 모ëì ì½ëììë§ ìì½ì´ë¡ ì·¨ê¸ë©ëë¤:
implementsinterfaceletpackageprivateprotectedpublicstatic
ìì
>ì격 모ëì ì격íì§ ìì 모ëììì ìì½ì´
enum ìë³ìë ì¼ë°ì ì¼ë¡ ìì½ëì´ ììµëë¤.
js
var enum = { RED: 0, GREEN: 1, BLUE: 2 };
// SyntaxError: enum is a reserved identifier
ì격 모ëì ì½ëìì ë ë§ì ìë³ìë¤ì´ ìì½ëì´ ììµëë¤.
js
"use strict";
var package = ["potatoes", "rice", "fries"];
// SyntaxError: package is a reserved identifier
ì´ ë³ìë¤ì ì´ë¦ì ë³ê²½í´ì¼ í©ëë¤.
js
var colorEnum = { RED: 0, GREEN: 1, BLUE: 2 };
var list = ["potatoes", "rice", "fries"];
ì¤ëë ë¸ë¼ì°ì ì ì ë°ì´í¸
ìë¡ì´ 구문ì ì¬ì©í기 ìí´ìë ìµê·¼ ë²ì ì ë¸ë¼ì°ì ë¡ ì
ë°ì´í¸ í´ì¼ í©ëë¤. ì를 ë¤ì´, ì¤ëë ë¸ë¼ì°ì 를 ì¬ì©íê³ ìë¤ë©´ let ëë class 구íí ì ììµëë¤.
js
"use strict";
class DocArchiver {}
// SyntaxError: class is a reserved identifier
// (ì¤ëë ë²ì ì ë¸ë¼ì°ì ììë§ ìë¬ê° ë°ìí©ëë¤. ì) Firefox 44 ì´í)