Skip to content
Devgo

JavaScript

The programming language of the web. Runs in every browser and on servers (Node.js). JavaScript makes web pages interactive — handling clicks, fetching data, updating the DOM, and building full applications. It's dynamically typed, single-threaded with an event loop, and multi-paradigm.

Created by

Brendan Eich · Created JavaScript at Netscape in 1995

When to use
  • All web frontends.
  • Backend services via Node.js for I/O-heavy workloads.
  • Cross-platform apps (React Native, Electron).
When not to
  • CPU-intensive compute (use Rust/Go/Python with native extensions).
  • Systems programming.

Definition

JavaScript is a high-level, dynamically typed, garbage-collected language with first-class functions, prototype-based OOP, and an event loop for async I/O. ES6+ added classes, modules, async/await, arrow functions, and destructuring. It runs in browsers (via V8/SpiderMonkey) and servers (, , ).

Why it exists

Browsers needed a scripting language for client-side interactivity. JavaScript won the browser war and grew into a general-purpose language via .

How it works

The JS engine parses, compiles (JIT), and executes code on a single thread with an event loop. Async operations (I/O, timers, fetch) use callbacks/promises/async-await without blocking. The API lets JS manipulate the page. uses V8 without the browser DOM.

Scaling limits

Single-threaded (one CPU core for JS; workers help). Dynamic types catch errors at runtime, not compile time ( fixes this). Large codebases need module systems and tooling.

Cost shape

Free and open. The cost is build tooling (bundlers, transpilers) and runtime performance tuning.

Alternatives

  • TypeScript — Adds static types to JS; safer but needs compilation.
  • WebAssembly — Run compiled languages in the browser for CPU-heavy work.

Failure modes

  • Runtime type errors (no compile-time checks without TS).
  • Blocking the event loop freezing the UI.
  • Callback hell (mitigated by async/await).

, , ,