Loading Depth Study
Preparing your workspace
Browser APIs are standardized interfaces that allow web applications to use browser capabilities such as storage, networking, timers, location, and more.
JavaScript in a browser is more than the language itself. The browser exposes APIs that provide access to web platform features. Examples include DOM APIs, Fetch, timers, storage, URL utilities, notifications, media features, and other capabilities. These APIs are environment features provided by the browser rather than built into the JavaScript language specification itself.
A web application can use fetch for network requests, localStorage for preferences, setTimeout for delayed work, and DOM APIs to update the page.
console.log(document.title);
setTimeout(() => {
console.log("Timer finished");
}, 1000);
localStorage.setItem("mode", "dark");The code uses DOM, timer, and storage APIs provided by the browser.