What you’ll learn
- Spread
...in every flavor - Rest parameters and rest destructuring
- Destructuring tricks (including swapping)
- Optional chaining
?. - Nullish coalescing
??vs `\ - \
- `
- Short-circuit tricks and `\
- \
- =
,&&=,??=` Setfor unique valuesMapfor flexible key-value pairs- Working with dates
The pages
Twelve pages, about 14 minutes.
- Welcome to Grade 13 Yes, Grade 13 exists. We warned you about this at Orientation. This grade is a collection of power-ups: features that…
- Spread: Unpacking Everything You've met the spread syntax ... a couple of times already. Let's collect all its tricks in one place. Spread unpacks…
- Rest: Packing Things Up The same three dots can also do the opposite of spread: pack several things into an array. When ... appears in a…
- Destructuring Deluxe You learned the basics of destructuring in Grade 8. Here are some more tricks. Remember the juice-and-milk swap puzzle…
- Optional Chaining: ?. Remember this error from Grade 8? The most common error in JavaScript? user.address is undefined, and you can't read a…
- Nullish Coalescing: ?? Often you want to use a default value when something is missing. You've seen the || trick for this. || returns the…
- Short-Circuit Tricks In Grade 3, the Professor mentioned that && and || are "lazy": they stop as soon as they know the answer. This is…
- Sets: Collections of Unique Values A Set is a collection of values where every value is unique. No duplicates allowed. If you try to add something that's…
- Maps: Flexible Key-Value Pairs A Map is like an object (it stores key-value pairs), but with some upgrades. Keys can be any type: numbers, objects…
- Working With Dates JavaScript has a built-in Date object for working with dates and times. It's a bit quirky (it's one of the oldest…
- Mini Project: The Data Cleaner In the real world, data is messy. Some fields are missing, some are empty, some have duplicates. Let's use our…
- Recap The key ideas of Grade 13, Modern JavaScript, on one page. Spread ... unpacks arrays, strings and objects: copying…
Reading is step one
CurlyScript turns these notes into a game: short questions, an explanation after every answer, and a test at the end of each grade. Free, with nothing to sign up for.