Contenu du cours
Module 1 — Discovering JavaScript
What JavaScript does, where to write your code, the console and a first script.
0/4
Module 2 — Language fundamentals
Variables and types, operators and conditions, then loops.
0/4
Module 3 — Functions and interactivity
Writing functions, responding to events and manipulating the DOM.
0/4
Module 4 — Going further
Arrays and objects, an introduction to APIs with fetch, and best practice.
0/4
JavaScript for beginners

A variable is a labelled box in which you store a value to reuse later. It is the basic building block of any program.

Declaring a variable

  • let — for a value that may change.
  • const — for a constant value that will never change.
let age = 25;
const prenom = "Marie";

The main data types

  • Number: 42, 3.14.
  • String: text between quotation marks.
  • Boolean: true or false.

Reach for const by default, and only use let when the value genuinely has to change. It makes your code clearer and prevents accidental reassignment.

Key takeaway: const for what stays put, let for what changes. Every value has a type: number, string or boolean.

Prix indicatifs, convertis depuis l'euro