Environment

Language and Standard

JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.

Created at Netscape for making dynamic webpages, now used for server backends too because of JS Engines like V8 running outside a browser like in Node.js.

The language is standardized by Ecma International as ECMAScript Language Specification. Javascript is the most popular implementation of ECMAScript.

It is a JIT compiled interpreted language.

Many new languages are transpiled (converted) to Javascript before they run in the browser. Ex - TypeScript (Microsoft), Flow (Facebook), Dart (Google).

Deno was created by the creator of Node.js Ryan Dahl in 2018, based on V8 engine.

JS in browser

<!-- use script tags anywhere in HTML -->
<script>
	alert("A");
</script>
<script>
	alert("B");
</script>

<!-- or use external JS file -->
<script src="my.js">
	// any JS code written here will be ignored when using external script (src="")
</script>

JS in non-browser environment

# run with Node
$> node hello.js

# run with Deno
$> deno run hello.js