🚀

Modern JavaScript

The modern JavaScript you actually use in React and production code — spread & rest, default parameters, object shorthand, the array-method toolkit (map/filter/reduce), safe data access, and async patterns. The bridge from vanilla JS to frameworks.

1

What Modern JavaScript Means

Meet the modern JavaScript toolkit — the features added since 2015 that make code shorter, safer, and that every framework like React is built on.

2

Default Parameters

Give function parameters fallback values so callers can leave them out — the clean modern replacement for the old `x = x || fallback` trick.

3

Spread and Rest (...)

Use the ... operator to copy and combine arrays and objects without mutating them — the exact technique React state updates rely on — and to collect extra arguments.

4

Object Shorthand & Computed Keys

Write objects with less repetition using property shorthand, and build objects with dynamic keys using computed property names — both everywhere in React.

5

Transforming Data with map

Use .map() to turn one array into another by transforming every item — the single most important array method in React, where it powers every rendered list.

6

Selecting Data: filter, find, some, every

Keep only the items you want with filter, grab the first match with find, and ask yes/no questions about a list with some and every.

7

Boiling Down Data with reduce

Use .reduce() to collapse an array into a single value — a total, a maximum, a count, or a grouped object. The most powerful (and most feared) array method, made simple.

8

Chaining: Data Pipelines

Chain map, filter, and reduce together to turn raw data into exactly what your UI needs — the data-shaping every React component does before it renders.

9

Destructuring in Practice

Pull values straight out of objects and arrays — in function parameters (the React props pattern), in the useState shape, and while looping objects with Object.entries.

10

Safe Data Access: ?. and ??

Read deeply nested or possibly-missing data without crashing using optional chaining (?.), and supply clean fallbacks with nullish coalescing (??).

11

Async Patterns & Promise.all

Recap async/await, then run several async tasks at once with Promise.all — the difference between a snappy page and a slow one.

12

Capstone: A Sales Summary

Combine filter, map, reduce, and object shorthand to turn a raw array of orders into a clean summary — exactly the data-shaping a real dashboard does.

13

Codelab: A Shopping-Cart Module

Build a real shopping-cart data layer in a plain HTML file — immutable add/remove with spread and filter, totals with reduce — and run it in your browser.