“This is the 17th day of my participation in the Gwen Challenge in November. See details of the event: The Last Gwen Challenge in 2021”.

Interpreted and compiled languages

6.1 overview,

Computers cannot directly understand any language other than machine language, so they must translate what programmers write into machine language in order to execute their programs. A tool that translates program language into machine language is called a translator.

There are two ways translator can translate: one is compilation, the other is interpretation. The difference between the two methods lies in the time point of translation:

  • The compiler compiles the code before it is executed, generating intermediate code files.
  • An interpreter is an interpreter that interprets at run time and executes immediately (also called an interpreter when the compiler runs in interpreted mode).

6.2 Execution process

Similar to a dinner party:

  • When you go out to a restaurant, cook everything before you serve it.
  • Explain language: like eating hot pot, eat while rinse, at the same time

Keywords and reserved words

7.1. Keywords

The keyword refers to the JS itself has used the word, can not be used as a variable name, method name.

Common keywords are: Break, case, catch, continue, default, delete, do, else, finally, for, function, if, in, instanceof, new, return, switch, this, throw, try, Typeof, var, void, while, with, etc.

7.2 reserved words

Reserved words are reserved “keywords”, meaning that they are not yet keywords, but may become keywords in the future, and cannot be used as variable names or method names.

If you use a reserved word as a variable name or function name, you will probably not receive any error messages unless future browsers implement the reserved word. When the browser implements it, the word is treated as a keyword, which causes a keyword error.

Common reserved words are: Boolean, byte, char, class, const, debugger, double, enum, export, extends, fimal, float, goto, implements, import, int, interface, long, Mative, package, private, protected, public, short, static, super, synchronized, throws, transient, volatile, etc.

7.3 identifiers

Zhi: The name of a variable, attribute, function, or parameter assigned by the developer. The identifier cannot be a keyword or a reserved word.