Introduction

JavaScript is a programming language used to make web pages interactive.

It is widely supported across all modern web browsers.

console.log("Hello, world!");
Variables

Variables store data values.

Use let, const, or var to declare variables.

let x = 5;
Functions

Functions are blocks of code designed to perform tasks.

You can define them using the function keyword.

function greet() { alert("Hi!"); }
Loops

Loops repeat blocks of code.

Common types: for, while, do...while.

for (let i = 0; i < 5; i++) { console.log(i); }
Arrays

Arrays hold multiple values in one variable.

Access elements by their index.

const fruits = ["apple", "banana"];