Lesson content
Read, practise, then check your understanding
window represents a browsing context and commonly acts as the global object for classic scripts. document exposes the DOM. The BOM includes location, history, navigator, screen, timers, and related host facilities.
Navigation state
const url = new URL(location.href);
url.searchParams.set("chapter", "arrays");
history.pushState({ chapter: "arrays" }, "", url);
addEventListener("popstate", event => restore(event.state));
History APIs change session entries, not server data. Capability detection is better than user-agent sniffing. Respect same-origin rules, permissions, lifecycle events, accessibility, and back-button expectations. Browser APIs may be absent in workers, servers, tests, or older clients, so isolate host-dependent code.
Knowledge check
Answer every question correctly to complete this chapter.
0 of 10 checks passed
Your progress is saved on this device.