thecodex.expert · The Codex Family of Knowledge
Track 1 — Foundations

JavaScript: Foundations

Five lessons from your first JavaScript line to arrays, objects, and destructuring — no experience needed.

🕐 ~3 hours5 lessonsES2024

Lessons

Lesson 1

What JavaScript is and how it runs

Understand what JavaScript is, where it runs (browser and Node.js), and how the script tag works.

Prerequisite: None — start here.

What to look for:

  • The Curious tab — read only this level first
  • The critical notes panel — all 7 points
  • How JavaScript differs from Python in one sentence
  • What "interpreted at runtime" means
🕑 20 min
Lesson 2

Variables, types, and type coercion

const/let/var, the 8 types, and why == is dangerous. The most important 40 minutes in JavaScript.

Prerequisite: Lesson 1

What to look for:

  • The type table — memorise the typeof column
  • The coercion examples — run each one in your browser console
  • The falsy values table — all 8, especially [] and {} being truthy
  • The == vs === section — use === always
🕑 40 min
Lesson 3

Control flow and loops

if/else, switch, for, for...of, for...in, while, break/continue, ternary operator.

Prerequisite: Lesson 2

What to look for:

  • The JavaScript tab on the concepts page
  • for...of (iterates values) vs for...in (iterates keys)
  • The ternary expression for concise conditions
  • Optional chaining ?. — how it prevents "cannot read property of undefined"
🕑 30 min
Lesson 4

Functions and scope

Function declarations, expressions, arrow functions, default parameters, closures, and the LEGB scope model.

Prerequisite: Lessons 1–3

What to look for:

  • The three function syntaxes and when each is hoisted
  • Closures — the counter example and why it works
  • The this section in Curious — just understand that arrow functions fix it
  • Rest parameters ...args — the array, not arguments
🕑 45 min
Lesson 5

Arrays, objects, and destructuring

Array methods (map/filter/reduce), object literals, spread/rest, and destructuring with defaults.

Prerequisite: Lessons 1–4

What to look for:

  • The Exploring tab — destructuring section completely
  • Spread (...) operator for arrays and objects
  • Object shorthand {name, age} instead of {name: name, age: age}
  • Array methods: map (transform), filter (select), reduce (accumulate)
🕑 40 min

How to use this track: Each lesson links to the relevant Codex reference page. Use the reading level tabs (Curious / Exploring / Deep Dive). The "what to look for" bullets guide your focus. Come back for the quiz when ready.

Try it now

Edit the code and press Run — or Ctrl+Enter. No install needed.

💡 JavaScript
Output
Press Run to see output…

Want a bigger editor with example snippets? Open the full JS playground →

Track quiz

Four questions to check your understanding of the Foundations track.

What is the output of: console.log(typeof null)?

Which value is truthy in JavaScript?

What does const prevent?

Arrow functions differ from regular functions in which key way?