JavaScript Runtime Environment

What is a "runtime" environment?

the "runtime" environment is the code that runs your code

function isEven (num) {
  if(num % 2 === 0) {
    return `${num} is even!`;
  } 
}

console.log(isEven(10);

We have a program but...

How

do we

run it????

V8 Engine:

  • Written in C++
  • Compiles Code
  • Runs Code (is the runtime)

Chrome Web Browser:

  • Debugger
  • Web and DOM API
  • Uses the V8 Engine

JS File

  • Needs a runtime to execute/run a program

V8 Engine:

  • Written in C++
  • Compiles Code
  • Runs Code (is the runtime)

NodeJS

  • File System API
  • Server Side
  • Runs on the V8 Engine

JS File

  • Needs a runtime to execute/run a program

Why learn about the JS runtime?

  • Makes debugging easier
  • Understand Scope and Closure under the hood
  • The ability to reason what the "this" keyword references
  • Read and reason through pre-written code

  • It is hard, most JS Developers don't have an understanding of this material

JS Runtime Environment

By Scott D'Alessandro

JS Runtime Environment

  • 486