Javascript does not require compilation. JavaScript is an interpreted, literal scripting language. The browser directly interprets the source code and can run it directly. Programs written in JavaScript will be interpreted and executed line by line during the running process, and no pre-compilation is required.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
JavaScript is an interpreted scripting language. Unlike C, C and other languages that need to be compiled first and then run, code written in JavaScript does not need to be compiled and can be run directly. Programs written in JavaScript will be interpreted and executed line by line during the running process, and no pre-compilation is required.
Interpreted language appears directly in the form of source code, and is parsed into machine code and executed in real time when running. All scripting languages (including JavaScript of course) are interpreted languages. The biggest feature of this type of language is that they cannot exist independently and must be parasitic in other programs (such as browsers).
Interpreted languages are translated when the program is run. For example, interpreted basic language has a dedicated interpreter that can directly execute the basic program, and each statement is translated when it is executed. In this way, the interpreted language must be translated every time it is executed, which is relatively inefficient.
[Recommended learning:javascript advanced tutorial]
The above is the detailed content of Does javascript need to be compiled?. For more information, please follow other related articles on the PHP Chinese website!