[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Errors/Reserved_identifier [Back]  [Original]

SyntaxError: "x" is a reserved identifier - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

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)

In this article

SyntaxError

?

. :

  • enum

, (strict mode):

  • implements
  • interface
  • let
  • package
  • private
  • protected
  • public
  • static

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  )


Web Proxy Viewer  |  New URL  |  Original Page