JavaScript is called a scripting language because it was originally created to “script” the browser — that is, to automate and control behavior inside another host environment (like HTML pages in a web browser), not to build standalone applications like C or Java programs.
Historically, scripting languages were interpreted rather than compiled, which is where the confusion comes from. But in modern JavaScript engines (like V8, SpiderMonkey, etc.), the code is actually parsed and JIT-compiled (Just-In-Time) into machine code at runtime for performance. So today, JavaScript is both interpreted and compiled, depending on which part of the execution pipeline you look at.
As for 0 == '' being true — that happens due to type coercion rules defined in the ECMAScript specification, not because of compilation. When you use ==, JavaScript automatically converts both operands to a common type before comparing. Here, '' (an empty string) is converted to the number 0, so the comparison becomes 0 == 0, which is true.
If you want to avoid this kind of behavior, always use strict equality (===), which doesn’t perform type coercion.