I have read enough explanation about the definition of compiler, interpreter and "things" that use both. I didn't find how compiler and interpreter both are used in one language.
In Java the source code is first compiled to bytecode and then it's run by an interpreter (JVM - Java Virtual Machine).
bytecode is machine code for a virtual machine.
In Javascript there's a runtime (engine) that does just in time compilation (JIT). Basically, at execution time it's given a source code which it immediately converts to native code and then the code is executed. In Chrome's engine there are two modules that do compilation: one can execute code fast but the code isn't much optimized (ignition interpreter) and the other produces a highly performant code but compilation takes more time (turbofan compiler).
Why use both: