Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Reserved keywords in JavaScript | JavaScript syntax
Introduction to JavaScript
セクション 2.  6
single

single

bookReserved keywords in JavaScript

メニューを表示するにはスワイプしてください

What are keywords

JavaScript uses many identifiers as the keywords for language to give power to the language itself. We should avoid using keywords as identifiers for our programs.

Following is the link to a list of some commonly used keywords All Reserved Keywords in JavaScript:

Note: Those keywords are for a specific purpose and perform a specific task that empowers the language itself.

ECMAScript 5 reserved keywords

Some keywords are not used by the language but also reserved. We should avoid them. They will be used in the next versions ECMAScript5 reserves the following words:

class, const, enum, export, extends, import, and super.

Following are some legal ordinary JavaScript words but they are reserved in strict mode: implements, let, private, public, yield, interface, package, protected, and static.

Note: This strict context forbids particular actions from being taken and sends more exceptions. The statement “use strict”; guide the browser to use the Strict mode, which is a reduced and safer feature set of JavaScript.

タスク

スワイプしてコーディングを開始

Your task is to replace the above problematic variables with some legal names.

解答

Best Practises

We should avoid the use of predefined several global variables and functions names for identifier name. Note: There are brief lectures regarding global variables and functions.

Summary:

  • Keywords should not be used for identifiers.
  • Keyword is of specific purpose do not use them for variables name.
  • We should also take care of the ECMAScript 5 reserved keywords while naming our variables.
  • It is best practice to use a strict mode.

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  6
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt