Skip to content
  • Introduction to JavaScript · JavaScript

Introduction to JavaScript

LearnViaNotes @learnvianotes· 2 min read

The language of the web — a dynamic, garbage-collected, single-threaded language with first-class functions, now running everywhere from browsers to servers to phones.

Why JavaScript?

A short history

YearMilestone
1995Brendan Eich writes it in ~10 days at Netscape (Mocha → LiveScript → JavaScript).
1997Standardised as ECMAScript 1 by Ecma International.
2009ES5: strict mode, JSON, Array.prototype.map/filter/reduce. Node.js is released.
2015ES6 / ES2015 — the big one: let/const, arrows, classes, modules, promises, destructuring, Map/Set.
2016 →Yearly editions: async/await (2017), ?. and ?? (2020), top-level await (2022), toSorted (2023), Object.groupBy (2024)…

Engines and runtimes

An engine parses and executes JavaScript. A runtime wraps an engine and adds APIs to talk to the outside world (DOM, files, network, timers).

EngineUsed by
V8 (C++)Chrome, Edge, Node.js, Deno, Electron
SpiderMonkeyFirefox (the first JS engine ever)
JavaScriptCoreSafari, Bun, React Native (with Hermes as an alternative)
RuntimeExtra APIs it provides
Browserwindow, document (DOM), fetch, localStorage, setTimeout, events
Node.jsfs, path, process, http, Buffer, EventEmitter, CommonJS + ESM modules
Deno / BunNode-compatible APIs, built-in TypeScript, secure-by-default (Deno)

Your first program

JavaScript
const language = "JavaScript";
const year = 1995;
console.log(`Hello, ${language}! Born in ${year}.`);
console.log(typeof language, typeof year);
console.log([1, 2, 3].map((n) => n * 2));
Output
Hello, JavaScript! Born in 1995.
string number
[ 2, 4, 6 ]
Terminal
$ node --version            # check Node
$ node app.js               # run a file
$ node                      # interactive REPL (.exit to quit)
$ node --watch app.js       # re-run on every save

In a browser, open DevTools (F12) → Console and type expressions directly, or load a file with <script src="app.js" defer></script>.

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report