Get the App
SLTechnology News&Howtos  ›  Development  › 

How to understand reserved words in javascript

Shulou Source: shulou.com Published: 2022-06-03 16:32:08 10月04日 Update

This article is about how to understand the reserved words in javascript. The editor thinks it is very practical, so I hope you can get something after reading this article. Let's take a look at it with the editor.

1. Reserved words are a set of names (or commands) that are ready to be used within the JavaScript language specified by ECMA-262.

2. Cannot be used as variable, function name, object name, etc. The reserved word is reserved for the upgraded version of JavaScript and is not recommended for users.

ECMAScript 3 lists all Java keywords as reserved, while ECMAScript 5 is more flexible.

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

Note:

Do not use the reserved words listed above when defining variable names, function names, or attribute names, whether in strict mode or in non-strict mode, so as not to fall into the trap.

The above is how to understand the reserved words in javascript. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Patterns functions variables that is more knowledge articles practical free key keywords names commands objects properties work meetings suggestions articles is in the version Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft Apple NVidia Linux