Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand reserved words in javascript

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report