About
Javascript Interpreter (JavaScript engine) is a software which interprets and executes JavaScript code.
Javascript can run in two different environment:
- within a browser
If the javascript script has no dependencies to the DOM, it can be run in a non-browser JavaScript environment.
The JavaScript engine actually compiles the program on the fly and then immediately runs the compiled code.
Type
Browser (UI)
Although there are several uses for a JavaScript engine, it is most commonly used in web browsers. The developer tools of the browsers have a javascript interpreter that you find mostly in the console
Non-Browser (Cli) (Server / Desktop)
C:
- node.js gives also a console of V8
- Google V8 written in C++
- react native (ie mobile)
- Windows Script Host ie WScript.exe: Javascript - Jscript
Java:
- J2v8 - set of Java bindings for Google’s popular JavaScript engine, V8.
- Rhino - The Mozilla JavaScript Engine is named “Rhino”. Rhino is implemented in Java.
Chrome:
- Chrome lets you run javascript expression with the Chrome Cli mode (headless)
??
- SpiderMonkey
- Chakra
Javascript Compatibility
All engine does not necessarly implement all statement of javascript.
This project compat-table helps you better understand the statement supported by the javascript engine.
Management
Get
if (typeof document !== 'undefined') {
// We are in a browser context
} else {
// We are in a non-browser context (node,..)
}