JavaScript
Definition
JavaScript (often abbreviated JS) is a high-level, interpreted, multi-paradigm programming language primarily used for web development. Created by Brendan Eich at Netscape in 1995, it is the dominant language of the web, running in every major browser and increasingly on servers.
Key Details
- Paradigm: Multi-paradigm (object-oriented, functional, imperative, event-driven)
- License: ECMA-262 standard; implementations vary (V8: BSD, SpiderMonkey: MPL)
- Runtime: V8 (Chrome/Node.js), SpiderMonkey (Firefox), JavaScriptCore (Safari), JavaScriptEngine (others)
- Creator: Brendan Eich (created in 10 days)
- Standardization: ECMAScript (ECMA-262) — annual release cycle since 2015
Language Features
- Dynamic typing: Types resolved at runtime
- First-class functions: Functions as objects, closures, higher-order-functions
- Prototype-based OOP: No classes in the original spec (ES6 added class syntax)
- Event loop: Asynchronous, non-blocking I/O model
- Garbage collection: Automatic memory management (mark-and-sweep)
- Weak typing: type-coercion can lead to subtle bugs
ECMAScript Evolution
| Version | Year | Key Features |
|---|---|---|
| ES5 | 2009 | Strict mode, JSON, array methods |
| ES6/ES2015 | 2015 | Classes, arrow-functions, template-literals, destructuring, promises |
| ES2016 | 2016 | Array.prototype.includes, exponentiation-operator |
| ES2017 | 2017 | async/await, Object.values, shared-memory |
| ES2018 | 2018 | async-iterators, rest-spread, promise-finally |
| ES2019 | 2019 | flatMap, optional-catch, string-trim |
| ES2020 | 2020 | nullish-coalescing, optional-chaining, BigInt, import-maps |
| ES2021 | 2021 | logical-assignment, string-replaceAll |
| ES2022 | 2022 | class-fields, top-level-await, Array.at |
| ES2023 | 2023 | Array.groupBy, findLast |
| ES2024 | 2024 | pipeline-operator, records-tuples |
Major Runtimes and Engines
| Engine | Implementation | License |
|---|---|---|
| V8 | Chrome, Chromium, Node.js | BSD 3-Clause |
| SpiderMonkey | Firefox | MPL 2.0 |
| JavaScriptCore | Safari, WebKit | LGPL / BSD |
| JavaScriptCore (JSC) | iOS, macOS | LGPL / BSD |
Server-Side (Node.js)
| Package Manager | Description |
|---|---|
| npm | Node Package Manager — largest package registry |
| yarn | Faster, deterministic builds (Facebook) |
| pnpm | Disk-efficient, hardlinked packages |
| Bun | Newer runtime with built-in bundler and test runner |
Use Cases
- Client-side web development (DOM manipulation, event handling)
- Server-side applications (Node.js, Express, NestJS)
- Mobile apps (React Native)
- Desktop apps (Electron)
- CLI tools (npm packages)
- machine-learning (TensorFlow.js)