Skip to main content
← ⚑ JavaScript & the browserΒ·Module C9 Β· Lesson 11
TaskQuick recap. Inside <script type='module'>: const u = new URL('https://x.test/path?id=42&tag=hello'); log u.searchParams.get('id'). localStorage.setItem('k', JSON.stringify({n: 7})); log JSON.parse(localStorage.getItem('k')).n. Build const qs = new URLSearchParams({a:'1', b:'2'}).toString(); log qs. const copy = structuredClone({x:[1,2]}); log copy.x.length.

Recap: Tooling, types, browser APIs (C7-C9)

50 XP5 min
Theory

Quick recap β€” Modules C7-C9

The platform APIs you reach for daily. The 4 things every browser app needs:

  1. `localStorage.setItem` + `getItem` β€” persist tiny state across reloads. Stringify, JSON.parse on read.
  2. `new URL(href)` β€” parse a URL safely. Read .searchParams.get(key) instead of regex.
  3. `URLSearchParams` β€” build query strings without manual encoding bugs.
  4. `structuredClone(x)` β€” deep copy that handles dates, maps, sets. No more JSON.parse(JSON.stringify).

If any feels random, redo C9-02 / C9-04 / C9-07 / C9-09 then come back.

πŸ”’

Sign up to start coding

Theory is open to everyone. The interactive editor, live preview, and check are unlocked with a 7-day free trial β€” card required, cancel anytime.

Sign up β€” free trial β†’

First 15 lessons in each track are free. No card needed for those.

← Previousβœ“ Module complete

Get one Python or web tip a day β€” by email

Short, hand-written, no spam. Unsubscribe in one click.