Javascript language is also translated into C language, so does it go back in browser???

Asked 1 years ago, Updated 1 years ago, 65 views

browser javascript

2022-09-22 13:15

1 Answers

Javascript is a scripting language. So you don't need a compilation process.

The script language features are described in this way.

It is executed by analyzing text in real time without going through the compilation process. (Some scripting languages support simple compilation) If there is a grammatical error in the code, it is found at the time of execution. (In recent years, it is often found in the parsing stage before execution.)

When JavaScript is run in a browser, it is interpreted one line at a time by the interpreter included in the browser.

You'll understand if you look at the following example that it runs one line at a time. If you look at the JavaScript code below, there is a grammar error in the else statement. But if you press "Run" underneath the code, it'll run without a problem.

However, compilation languages such as c are not allowed because they run after compiling the entire code. Press the Run code button below to run the code below. An error occurs during the compilation process, even if the else statement cannot be executed.

In this way, the compilation language and the script language behave differently. JavaScript, a scripting language, is not compiled into other languages, and the browser reads one line at a time and executes it.


2022-09-22 13:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.