JavaScript
JavaScript runs in every web browser and makes pages interactive — responding to clicks, updating content, and talking to servers.
The DOM
The Document Object Model is the page represented as objects you can read and change.
const title = document.querySelector("h1");
title.textContent = "Updated!";
Events
You react to user actions by listening for events.
button.addEventListener("click", () => {
console.log("clicked");
});
Promises and async
Network calls return later, so JavaScript uses promises and async/await to handle them without freezing the page.
async function load() {
const res = await fetch("/data.json");
const data = await res.json();
console.log(data);
}