Hi all,

Hopefully this isn't a repeat of another question but I can't find an answer which I feel satisfies my question.

I'm trying to understand the difference between JavaScript's JIT compiler and a typical JavaScript interpreter.

1.My understanding is that an interpreter reads each line of the JavaScript source code, converts it to machine code, executes it and then repeats for the next line. How is this different to a JIT compiler? Because I understand that they just compile the code just before it is executed (which sounds similar to an interpreter)?

2.Some people say that JavaScript cannot be called an interpreted language now. My understanding of an interpreted language is one which an interpreter parses a source code, compiles and executes it. The JIT compiler, in a way, does just that, as it doesn't compile the program which can be readily executed, it compiles the JavaScript just in time when it is require. Therefore, I would argue that it is still an interpreted language. With JavaScript now supporting JIT compilers, do you class it as an interpreted language or compiled?

I've sought information from other sites but haven't felt that they've helped too much. I've read in various places that an interpreter reads each line, line by line, and compiles this into machine code. I'm now further confused as I've been told that this is not the case. If this is the case, then how do they work? Eventually, at some point, the interpreted code has to boil down to compiled code.