JS: Module 1

← Dashboard
Module 1: The Spark

Variables & Data

Store information with let, const, and var. Work with strings, numbers, and booleans.

// Variables - prefer const, use let when reassigning
const flavor = "Espresso";
let shots = 2;
const isHot = true;

// Strings, Numbers, Booleans
const total = shots * 2.50;  // 5
const label = flavor + " x" + shots;  // "Espresso x2"
Pro Tip

Use const by default. Only use let when the value will change.

Data Types

Strings (text), Numbers, Booleans (true/false) — the basics.