JavaScript Foundations
Write correct, readable modern JavaScript: values and types, functions and closures, objects and arrays, modules and error handling.
4 objectives 6 steps about 145 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Write programs with variables, operators, conditionals and loops, predicting the result of type coercion and of strict vs loose equality.
- Define and compose functions (arrow functions, default and rest parameters, higher-order functions, closures) and explain lexical scope and how this is bound.
- Model and transform data with objects, arrays, Map and Set using destructuring, spread, optional chaining and non-mutating array methods such as map, filter, reduce and toSorted.
- Organize code into ES modules and handle failures with exceptions and custom Error subclasses.
Lesson plan
6 steps, about 145 min · 5 of 5 lessons available so far
- Values, Types and the Rules of Coercion Concept · 20 min
- Control Flow and Stepping Through Code with Breakpoints Worked example · 20 min
- Functions, Scope and Closures Concept · 25 min
- Shaping Data with Objects, Arrays, Map and Set Worked example · 30 min
- Classes, this, Modules and Errors Concept · 25 min
- Check: Predict the Output, Then Pass the Kata Tests Knowledge check · 8 questions
Practise it
Write an ES module of pure functions that take a JSON array of orders and return totals per customer, the five best-selling products and a list of invalid records (raised as a custom ValidationError), passing a provided test suite without mutating the input.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own PromiseIntro · 3–6 h
- Build your own ReduxIntro · 3–6 h
- Build your own Browser GameIntro · 4–10 h
- Build your own ReactIntermediate · 6–12 h
- Build your own Module BundlerIntermediate · 4–8 h
References
Hard prerequisites
None.
Unlocks
On these roadmaps
Progress and evidence for this skill are shared across all of them.