"We need a language for the browser. And we need it fast."
Originally: Mocha → LiveScript → JavaScript
10 Days in May
In 1995, Brendan Eich created JavaScript in just 10 days at Netscape. Originally called 'LiveScript', it was renamed to ride the popularity of Java. But they are completely different languages—like ham and hamster.
The Skeleton (HTML)
Think of a webpage like a human body. HTML is the SKELETON. It gives the page structure—headers, paragraphs, buttons. Without it, there's just... nothing.
The Clothing (CSS)
CSS is the CLOTHING and SKIN. It makes the skeleton look good. Colors, fonts, layouts. But... the body is still a mannequin. It can't move or think.
The Brain (JavaScript)
JavaScript is the BRAIN and MUSCLES. It wakes the page up. Suddenly, the mannequin comes alive! It can calculate, remove elements, and change its own outfit.
Rules of the Road
Before we drive, we need to know the laws. JavaScript is CASE-SENSITIVE ('Name' ≠ 'name'). It ignores whitespace. And statements usually end with a semicolon (;). Easy, right?
The Memory (Variables)
How does the brain remember things? VARIABLES. Think of them as labeled boxes. We put data (names, numbers, scores) inside so we can use them later.
The Skills (Functions)
What can the brain DO? FUNCTIONS. These are like skills or recipes. 'Jump', 'Calculate Score', 'Say Hello'. We define the skill once, and use it whenever we want.
The Senses (Events)
The brain needs to react to the world. EVENTS are its senses. 'Did the user click?', 'Did they type?', 'Did they scroll?'. JavaScript listens and reacts instantly.
Beyond the Body (Node.js)
JavaScript grew so strong it escaped the browser. Now, with Node.js, it runs on servers, talking to databases and powering entire backends. It's everywhere.
You understand the core.
HTML for Structure. CSS for Style. JavaScript for Logic. You are ready to write your first line of code.