You are filling in the online application for a job circular. You type your mobile number, 0171234, and press Tab to move to the next box. Before you have touched anything that says Submit, a red line appears under the box: "Mobile number must have 11 digits." You fix the number and the line disappears. A little further down you pick your district, and the list of upazilas below it changes to match. Nobody reloaded the page, and the server was not asked a single question.
Who did all that? A small program that came down with the page and is running, right now, inside your browser on your own computer. It is written in JavaScript, and it is the one programming language every browser in the world understands. HTML gave the page its structure and CSS gave it its looks. JavaScript gives it behaviour: checking, calculating, reacting to clicks, changing what is on the screen.
This chapter teaches the language itself, from the first line. How a script reaches into the page to change a heading or catch a click belongs to a later lesson, Browsers, Rendering, the DOM and the Shape of a Website, and fetching data from a server comes later still. What you learn is the ground they all stand on, and the ground the exams test: where JavaScript came from, how a script is put into a page and what defer and async do, how variables, scope and hoisting really work, why "3" + "4" is "34", how functions, this and closures behave, how map, filter and reduce handle arrays, and in what order timers, Promises and async/await run.