typestar

Languages

JavaScript

Written in ten days, now the only language every computer with a screen can run.

First released
1995
Created by
Brendan Eich, at Netscape
Typing
Dynamic and weak, with coercion
File extensions
.js, .mjs, .cjs

What it is for

Browsers execute JavaScript. No other language can take that job, which makes it the most widely deployed language in history by a margin that is not close. It won that position by accident of history rather than merit, and it has spent thirty years growing into work it was never designed for.

Node.js took it off the client in 2009 and gave it an unusual second act as a server language. The argument was never that it was the best tool for a back end. It was that one language across the whole stack is worth real money to a small team, and that the event loop happens to suit I/O-bound work.

These days it also runs build tooling, desktop apps through Electron, mobile through React Native, and serverless functions. Ubiquity has a price: the language must never break the web, so every mistake it has ever made is still in there. TypeScript exists largely to manage the consequences.

Where it came from

Brendan Eich wrote the first version at Netscape in 1995, famously in about ten days, under a brief to make something Scheme-like that looked like Java. The name was a marketing decision. You can still see the schedule in the parts nobody defends: type coercion, two null-ish values, automatic semicolon insertion.

Standardization as ECMAScript followed in 1997, and then the language stalled. ECMAScript 4 was abandoned after years of argument and the web made do with ES3 for most of a decade. ES5 landed in 2009 with strict mode and real JSON support. The turning point was ES2015: let and const, arrow functions, classes, modules, promises, destructuring. Modern JavaScript more or less starts there.

TC39 moved to a yearly release train afterwards and the language has improved steadily and quietly ever since. Async/await, optional chaining, nullish coalescing, top-level await. Nothing is ever removed, so the old edges remain. The skill now is knowing which subset to write.

What it is like to type

JavaScript is a punctuation workout. Arrow functions keep => under your fingers, callbacks and promises nest braces and parentheses several deep, and template literals move you onto the backtick and ${}, three awkward reaches in a row. Practicing it is mostly practicing the symbol row and the discipline of closing what you open.

Practice JavaScript

118 steps across 6 tours, from the basics to complete programs.

The tours

Official documentation

Other languages