22 sections Β· 22 cheat sheets Β· 22 project files Β· Beginner β Advanced
js-roadmap/
βββ README.md β You are here
βββ / β Theory + syntax reference (22 files)
β βββ 01-introduction-setup.md
β βββ 02-variables-data-types.md
β βββ 03-type-conversion-comparison.md
β βββ 04-operators.md
β βββ 05-control-flow.md
β βββ 06-loops-iterations.md
β βββ 07-functions.md
β βββ 08-execution-context-scope.md
β βββ 09-arrays.md
β βββ 10-objects.md
β βββ 11-strings-numbers-date.md
β βββ 12-dom.md
β βββ 13-events.md
β βββ 14-advanced-concepts.md
β βββ 15-oop.md
β βββ 16-prototypes.md
β βββ 17-async-javascript.md
β βββ 18-api-networking.md
β βββ 19-es6-features.md
β βββ 20-modules-code-organization.md
β βββ 21-projects.md
β βββ 22-bonus-advanced.md
βββ / β Runnable practice files (22 files)
βββ 01-introduction-setup.js
βββ 02-variables-data-types.js
βββ 03-type-conversion-comparison.js
βββ 04-operators.js
βββ 05-control-flow.js
βββ 06-loops-iterations.js
βββ 07-functions.js
βββ 08-execution-context-scope.js
βββ 09-arrays.js
βββ 10-objects.js
βββ 11-strings-numbers-date.js
βββ 12-dom.js
βββ 13-events.js
βββ 14-advanced-concepts.js
βββ 15-oop.js
βββ 16-prototypes.js
βββ 17-async-javascript.js
βββ 18-api-networking.js
βββ 19-es6-features.js
βββ 20-modules-code-organization.js
βββ 21-projects.js
βββ 22-bonus-advanced.js
# Prerequisites
node --version # Need Node.js 18+ (for native fetch)
npm --version
# Run any project file
node projects/01-introduction-setup.js
node projects/09-arrays.js
node projects/17-async-javascript.js
# Run all project files in sequence
for f in projects/*.js; do echo "--- $f ---"; node "$f"; done| # | Section | Key Topics | Run |
|---|---|---|---|
| 01 | π° Introduction & Setup | JS engine, Node.js, console, debugging | node projects/01-introduction-setup.js |
| 02 | π§ Variables & Data Types | var/let/const, 7 primitives, stack vs heap | node projects/02-variables-data-types.js |
| 03 | π Type Conversion | Coercion, truthy/falsy, == vs === | node projects/03-type-conversion-comparison.js |
| 04 | β Operators | Arithmetic, logical, ??. ?., bitwise | node projects/04-operators.js |
| 05 | π Control Flow | if/else, switch, ternary, guard clauses | node projects/05-control-flow.js |
| 06 | π Loops | for, while, for..of, for..in, iterators | node projects/06-loops-iterations.js |
| 07 | π§© Functions | Declaration, arrow, closures, curry, HOF | node projects/07-functions.js |
| 08 | π¦ Execution Context | Call stack, scope chain, hoisting | node projects/08-execution-context-scope.js |
| 09 | π§± Arrays | map/filter/reduce, flat, sort, iterators | node projects/09-arrays.js |
| 10 | ποΈ Objects | Destructuring, spread, Proxy, descriptors | node projects/10-objects.js |
| 11 | π Strings, Numbers, Date | Methods, regex, Math, Intl, Date ops | node projects/11-strings-numbers-date.js |
| 12 | π DOM | Select, manipulate, create, delete elements | node projects/12-dom.js (+ open HTML in browser) |
| 13 | π±οΈ Events | Listeners, bubbling, delegation, custom EventEmitter | node projects/13-events.js |
| 14 | π Advanced Concepts | this, call/apply/bind, closures, IIFE | node projects/14-advanced-concepts.js |
| 15 | 𧬠OOP | Classes, inheritance, mixins, abstract, patterns | node projects/15-oop.js |
| 16 | π§ͺ Prototypes | Prototype chain, Object.create, descriptors | node projects/16-prototypes.js |
| 17 | β³ Async JavaScript | Callbacks, Promises, async/await, queues | node projects/17-async-javascript.js |
| 18 | π API & Networking | fetch, CRUD, caching, streaming, abort | node projects/18-api-networking.js |
| 19 | βοΈ ES6+ Features | Map/Set, Symbols, Generators, Proxy, tagged templates | node projects/19-es6-features.js |
| 20 | π§© Modules | ESM, CommonJS, patterns, DI container, plugins | node projects/20-modules-code-organization.js |
| 21 | π― Projects | To-Do CLI, Quiz, Budget Tracker, Text Analyser, Redux | node projects/21-projects.js |
| 22 | π Bonus / Advanced | Event loop, V8, memory, clean code, performance | node projects/22-bonus-advanced.js |
// typeof gotchas
typeof null // "object" β famous bug!
typeof [] // "object" β use Array.isArray()
typeof NaN // "number" β NaN is type number!
NaN === NaN // false β use Number.isNaN()
// == vs ===
null == undefined // true (only case!)
null === undefined // false
0 == "" // true (coercion)
[] == false // true (coercion)function makeCounter() {
let count = 0;
return () => ++count; // closes over count
}
const counter = makeCounter();
counter(); // 1
counter(); // 2// β Bug β all 3 (var leaks)
for (var i = 0; i < 3; i++) setTimeout(() => console.log(i), 0); // 3 3 3
// β
Fix β let creates new binding per iteration
for (let i = 0; i < 3; i++) setTimeout(() => console.log(i), 0); // 0 1 2console.log("1");
setTimeout(() => console.log("4"), 0);
Promise.resolve().then(() => console.log("3"));
console.log("2");
// Output: 1 β 2 β 3 β 4
// sync β microtask (Promise) β macrotask (setTimeout)const obj = {
name: "Alice",
regular() {
return this.name;
}, // this = obj β
arrow: () => this.name, // this = outer scope β
};// Promise chain
fetch(url).then(r=>r.json()).then(data=>...).catch(err=>...);
// async/await (same thing, cleaner syntax)
async function load() {
try {
const data = await fetch(url).then(r=>r.json());
} catch(err) { ... }
}// Every object β prototype β Object.prototype β null
const arr = [];
Object.getPrototypeOf(arr) === Array.prototype; // true
// arr.push() found on Array.prototype via chain- Section 1 β Setup & Console
- Section 2 β Variables & Types
- Section 3 β Type Conversion
- Section 4 β Operators
- Section 5 β Control Flow
- Section 6 β Loops
- Section 7 β Functions
- Section 8 β Execution Context
- Section 9 β Arrays
- Section 10 β Objects
- Section 11 β Strings, Numbers, Date
- Section 12 β DOM
- Section 13 β Events
- Section 14 β Advanced Concepts (this, closures)
- Section 15 β OOP
- Section 16 β Prototypes
- Section 17 β Async JavaScript
- Section 18 β API & Networking
- Section 19 β ES6+ Features
- Section 20 β Modules
- Section 21 β Projects
- Section 22 β Bonus & Advanced Topics
- Read the cheat sheet (
cheatsheets/NN-section-name.md) - Run the project file and study the output
- Modify the examples β break things and fix them
- Build your own small project using the concepts
- Explain it out loud (Feynman technique)
| Version | Year | Key Features |
|---|---|---|
| ES5 | 2009 | strict mode, JSON, Array.forEach |
| ES6/ES2015 | 2015 | let/const, arrow functions, classes, template literals, destructuring, Promises, modules |
| ES2016 | 2016 | Array.includes, ** exponentiation |
| ES2017 | 2017 | async/await, Object.entries/values, padStart/padEnd |
| ES2018 | 2018 | Rest/spread for objects, Promise.finally, async iteration |
| ES2019 | 2019 | Array.flat/flatMap, Object.fromEntries, optional catch binding |
| ES2020 | 2020 | BigInt, optional chaining ?., nullish coalescing ??, Promise.allSettled |
| ES2021 | 2021 | Promise.any, String.replaceAll, logical assignment ??= &&= ||= |
| ES2022 | 2022 | Class fields #private, Array.at(), Object.hasOwn, top-level await |
| ES2023 | 2023 | Array.findLast, Array.toSorted/toReversed/toSpliced (non-mutating) |
| ES2024 | 2024 | Promise.withResolvers, Object.groupBy, Map.groupBy |
| Tool | Purpose | Install |
|---|---|---|
| Node.js 20 LTS | Run JS outside browser | nodejs.org |
| VS Code | Editor | code.visualstudio.com |
| ESLint | Code quality | npm i -g eslint |
| Prettier | Auto formatting | npm i -g prettier |
| Nodemon | Auto-restart on file change | npm i -g nodemon |
| Vitest / Jest | Testing | npm i -D vitest |
| TypeScript | Type safety | npm i -g typescript |
- MDN Web Docs β developer.mozilla.org
- JavaScript.info β javascript.info β best free tutorial
- You Don't Know JS β Kyle Simpson (free on GitHub)
- Eloquent JavaScript β Marijn Haverbeke (free online)
- ECMAScript Spec β tc39.es/ecma262
- TC39 Proposals β github.com/tc39/proposals
Happy coding! π β Built for the JavaScript Interview Roadmap series