typestar

The browser

13 steps in 6 sets of JavaScript.

What JavaScript was invented for. The DOM, events and delegation, forms and storage, then observers and canvas.

Thirteen steps, and a recurring theme: the platform gives away more than people use. A lot of what gets reached for a library for is already here.

Start this tour

The DOM

Events

  • EventsListening for user interaction and form submission.
  • Event delegationOne listener on the container handles every child, now and later.
  • Custom eventsYour own event type, with a payload, bubbling like any other.

Forms & storage

  • FormsFormData reads the fields; the constraint API reports validity.
  • localStorageStrings only, synchronous, and it can throw when full.

Watching & drawing

  • ObserversIntersectionObserver and MutationObserver watch without polling.
  • A custom elementYour own tag, with shadow DOM and lifecycle callbacks.

URLs & formatting

  • URLs without a reloadpushState changes the address bar; popstate tells you about back.
  • IntlLocale-aware numbers, dates and relative times, built in.

Encore

  • event-bus.jsA typed-ish event bus: subscribe, emit, unsubscribe, and await one event.

The other JavaScript tours