Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Reserved keywords in JavaScript | JavaScript syntax
Introduction to JavaScript (staging)
course content

Kursinhalt

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

book
Reserved 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.

Aufgabe

Swipe to start coding

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

Lösung

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 desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 6
toggle bottom row

book
Reserved 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.

Aufgabe

Swipe to start coding

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

Lösung

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 desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 6
Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
We're sorry to hear that something went wrong. What happened?
some-alt