Home > Web Front-end > Front-end Q&A > What are the reserved words in javascript

What are the reserved words in javascript

青灯夜游
Release: 2023-01-07 11:47:14
Original
4654 people have browsed it

In JavaScript, reserved words are a set of names (or commands) prepared for use within the JavaScript language stipulated in ECMA-262. They cannot be used as variables, function names, object names, etc. Reserved words are reserved for JavaScript upgrades and users are advised not to use them.

What are the reserved words in javascript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

Reserved words

Reserved words are a set of names (or commands) prepared for use within the JavaScript language specified by ECMA-262. These names currently have no specific purpose and are reserved for JavaScript upgrade versions. Users are advised not to use them. Specific instructions are shown in the table.

ECMAScript reserved words
abstract double goto native static
boolean enum implements package super
byte export import private synchronized
char extends int protected throws
class final interface public transient
const float long short volatile

ECMAScript 3 lists all Java keywords as reserved words, while ECMAScript 5 has more flexible regulations.

For example, in non-strict mode, only class, const, enums, export, extends, import, and super are reserved words, and other ECMAScript 3 reserved words can be used freely; in strict mode, ECMAScript 5 becomes Be more cautious and strictly limit the use of implements, interface, let, package, private, protected, public, static, yield, eval (non-reserved words), and arguments (non-reserved words).

Note:

Whether in strict mode or non-strict mode, do not use it when defining variable names, function names or attribute names The reserved words listed above prevent students from falling into the trap.

[Recommended learning: javascript advanced tutorial]

The above is the detailed content of What are the reserved words in javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template