Is JavaScript a compiled language or an interpreted language?
Well, in the first place, MDN clearly says that JavaScript is an interpreted language (it also says JIT-compiled which I will address later in the article). Still there is a question that if JavaScript is really interpreted because of the following points.
- If interpreted then how does hoisting takes place?
- JIT (just-in-time compiler) makes code optimizations (also create compiled versions); interpreted languages can never do that.