-2

I've heard these terms used in different blogs and was curious if there was a difference.

Kyle Pennell
  • 5,144
  • 3
  • 45
  • 68

2 Answers2

2

A COMPILER converts source code (the code you've written) into machine code for the computer to understand.

An INTERPRETER directly executes your code without previously compiling it into machine code.

0

Javascript can be run with just an interpreter, the program that parses the script and executes the code.

However, some environments (like Chrome's V8 Javascript engine), will use a compiler to convert some of the Javascript code into a lower level language, which it can execute faster. It's a big part of why Javascript can be executed at near-native speeds now.

TbWill4321
  • 8,476
  • 2
  • 25
  • 24