Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the reserved words of javascript?

Shulou Source: shulou.com Published: 2022-06-02 07:36:04 10月02日 Update

This article mainly introduces "what is the reserved word of javascript". In the daily operation, I believe that many people have doubts about the reserved word of javascript. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the question of "what is the reserved word of javascript?" Next, please follow the editor to study!

The reserved words of javascript are: abstract, double, goto, native, static, boolean, enum, implements, package, super, byte, char, class, const, public and so on.

The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.

Reserved word of javascript

Reserved words are a set of names (or commands) that are ready to be used within the JavaScript language. These names currently have no specific use, are reserved for the upgrade version of JavaScript, and users are advised not to use them. The details are shown in the table.

JavaScript reserved word abstractdoublegotonativestaticbooleanenumimplementspackagesuperbyteexportimportprivatesynchronizedcharextendsintprotectedthrowsclassfinalinterfacepublictransientconstfloatlongshortvolatile

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

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 more cautious, strictly restricting the use of implements, interface, let, package, private, protected, public, static, yield, eval (unreserved words) and arguments (unreserved words).

JavaScript predefines many global variables and functions, and users should avoid using them, as shown in the table.

JavaScript predefined global variables and functions argumentsencodeURLInfinityNumberRegExpArrayencodeURLComponentisFiniteObjectStringBooleanErrorisNaNparseFloatSyntaxErrorDateevalJSONparseIntTypeErrordecodeURLEvalErrorMathRangeErrorundefineddecodeURLComponentFunctionNaNReferenceErrorURLError

Different JavaScript runtime environments predefine some global variables and functions, and the table above is only for the Web browser runtime environment.

Do not use the reserved words listed above when defining variable names, function names, or attribute names, whether in strict or non-strict mode.

At this point, the study of "what are the reserved words of javascript" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Function variable pattern learning global environment name more user help run different practical free next above table key keyword command that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Tech Info MySQL Apple macOS