Code24Lab
Web Development Beginner

JavaScript Foundations: Variables, Functions, Arrays & the DOM

Learn JavaScript by running real code in your head: variables, types, conditions, loops, functions, arrays, objects, DOM selection, events and a small cart app, with every answer checked as you go.

20 lessons 20 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

In this beginner course you learn JavaScript by thinking like the engine. Every lesson is a lab: a short script sits next to its data, and you work out what each variable holds, how often a loop runs, what a function returns or which elements a selector matches, with every answer checked instantly. You cover variables and types, string and number pitfalls, == versus ===, if/else and switch, while and for loops, functions, closures, arrays with map, filter and reduce, objects and references, selecting and changing the DOM, events and debugging. The course ends with a small cart app capstone, a 15-question exam and a certificate. The first lesson is free.

Lessons

  1. Variables & Values: Read Your First Script Like the EngineLabFree
  2. Numbers & Operators: Division, Remainder and RoundingLab Locked
  3. Strings: Indexes, slice() and Template LiteralsLab Locked
  4. Types & Coercion: Strings vs Numbers, == vs ===Lab Locked
  5. Decisions: if, else if, else and Logical OperatorsLab Locked
  6. switch, break and the Ternary OperatorLab Locked
  7. while Loops: Repeat Until a Condition ChangesLab Locked
  8. for Loops: Counters, Steps and Off-by-One ErrorsLab Locked
  9. Functions: Parameters, Defaults and returnLab Locked
  10. Scope and Closures: Functions That RememberLab Locked
  11. Arrays: Indexes, length, push, pop, shift and unshiftLab Locked
  12. map and filter: Transform and Select with Arrow FunctionsLab Locked
  13. reduce, find, findIndex and the sort() TrapLab Locked
  14. Objects: Properties, Spread Copies and ReferencesLab Locked
  15. Arrays of Objects: filter, map and reduce PipelinesLab Locked
  16. The DOM: Selecting Elements with CSS SelectorsLab Locked
  17. Changing the Page: textContent, classList and createElementLab Locked
  18. Events: Listeners, Handlers and StateLab Locked
  19. Debugging: Reading Errors and Fixing Classic BugsLab Locked
  20. Capstone: Run the Fernbrook Cart Mini AppLab Locked