Skip to main content

JavaScript is the common name for the language initially used for scripting in web browsers. It is NOT the same as Java. Use this tag for questions regarding ECMAScript and its dialects/implementations (excluding ActionScript and JScript).

JavaScript is a high-level interpreted, just-in-time (JIT) compiled language, most commonly used for interactive webpages with engines like V8 and SpiderMonkey, servers with environments such as Node.js, and applications with frameworks like Electron.

Tag usage

Use the tag for questions regarding ECMAScript and its dialects/implementations (excluding ActionScript and JScript). If the question is about one of the CLI tools such as npm or node.js, use the or tag instead. Questions mainly about programming in JavaScript should be asked in Stack Overflow.

Language Features

JavaScript includes features such as dynamic-typed variables, automatic semicolon insertion (ASI), garbage collection, regular expressions, type coercion, and several APIs provided including the document object model (DOM) and the fetch API for network requests. JavaScript is multi-paradigm, so functional, imperative, procedural, and object-oriented paradigms are built-in.

History

When websites could only contain HTML and CSS, the Netscape corporation decided to create a simplistic programming language allowing for dynamic webpages after content was loaded. So Brendan Eich was hired to formulate a language with a similar syntax to Java. Although it was initially called LiveScript, the name finalized to be JavaScript.

Eventually, JavaScript was soon standardized in the ECMAScript specification, and since then, the ecosystem has spread to include many frameworks and interpreters.

Syntax

JavaScript has a syntax inspired by languages such as C, Java, and Scheme.

Syntax information can be found directly in the specification or websites such as https://javascript.info or MDN Web Docs.

Specification

The specification for JavaScript is officially described in the ECMAScript language specification.

Usage

To execute JavaScript programs, JavaScript runtimes are necessary, or a competent browser such as Firefox or Chromium's built-in JavaScript engines can be used. The most common server-side runtimes include Node.js, Bun, and Deno. They can be installed in a system via its package manager, a repository, or by building from source.

NPM (Node Package Manager) is a utility for fetching libraries and frameworks developed with JavaScript.

Reference links

MDN Web Docs
Wikipedia