Prove that JS is not pure interpreted language.

Kamal Neupane

Kamal NeupaneFeb 28, 2023

1 min read186 words

js.jpg

A lot of people think languages like JS as well as python are Interpreted languages. But these are not interpreted language.


Interpreted language

Interpreted languages are those languages that don’t read your whole code previously, they execute your code line by line. That means if you have written five lines of code it will read line number 1 and execute it, then read line number 2 and execute it, and let’s say it finds an error at line number 3 then it will not execute anything after line number 3 but you will still get the output of the first two line.


Proof:

demo.js

console.log("Hello");
console.log("Reader");
3.console.log("uff");

If JS was a pure Interpreted language then you were supposed to get “Hello”, and ”Reader” (i.e the output of line numbers 1, 2) and then error of line 3 as output. But in reality, you get, output-error.png

So, what it really is?

It uses a combination of interpretation and JIT(Just In Time) compilation. So, we can consider it as a hybrid language (Interpreted + Compiled).