Home >Web Front-end >Front-end Q&A >Is javascript a compiled language?

Is javascript a compiled language?

青灯夜游
青灯夜游Original
2022-01-28 12:04:313032browse

Javascript is not a compiled language, but an interpreted language. JavaScript is a literal scripting language, and all scripting languages ​​are interpreted languages; code written in JavaScript does not need to be compiled and can be run directly. The browser will directly interpret the source code and perform operations such as creating variables in memory. .

Is javascript a compiled language?

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

Javascript is not a compiled language, but an interpreted language, a literal scripting language.

Compiled language is to first compile the source code into machine code (that is, the so-called executable program, such as the exe file of the Windows system). When running, the computer only needs Just hand the machine code to the CPU for execution. Compiled languages ​​are characterized by fast running speed and high efficiency. The disadvantage is poor portability.

Analytical language appears directly in the form of source code, and is parsed into machine code in real time during operation and executed.

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).

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.

Code written in JavaScript does not need to be compiled and can be run directly. Also because JavaScript is an interpreted language, this means that the system only knows whether each code is wrong when it is run.

Extended knowledge: interpreted vs compiled language

  • Compiled language is generally faster than interpreted language during runtime. Because the compiled language is already machine code, there is no need to interpret it into machine code.

  • Interpreted languages ​​can run and debug immediately after writing a line or a short program, and quickly test your ideas.

[Related recommendations: javascript learning tutorial]

The above is the detailed content of Is javascript a compiled language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn