Introduction to JavaScript
Take The Quiz
What is JavaScript?
JavaScript is the programming language of the web. HTML structures a page and CSS styles it; JavaScript makes it interactive — responding to clicks, updating content and talking to servers.
Where JavaScript runs
It runs in the browser (the front end) and, with Node.js, on servers too. One language, everywhere.
Variables: storing values
Declare values with let (can change) or const (cannot be reassigned). Avoid the old var.
const name = "Ada";
let score = 0;
score = 10;Prefer const by default
Use const unless you know the value will change; it states your intent and prevents accidental reassignment.
Data types you will meet
- String — text:
"hello" - Number —
42,3.14 - Boolean —
true/false - Array — a list:
[1, 2, 3] - Object — key/value pairs:
{ name: "Ada" }
Your first script
<script>
console.log("Hello from JavaScript!");
</script>Open the console
Press F12 → Console to see console.log output and any errors. It is your most important debugging tool.
Frequently asked questions
Is JavaScript the same as Java?
Do I need to install anything?
let or const?
const by default; switch to let only when the value must change.