Skip to main content
🟨 JavaScript Foundations

Read the Code πŸ‘€

Welcome! πŸ‘‹ You're about to write real JavaScript. We'll go one tiny step at a time, and you can't break anything.

Coders read a lot of code before they write any. So let's warm up by reading a couple of tiny programs and predicting what they do.

A variable is a named box that holds a value. You make one with const (a box whose value never changes) or let (a box you can change later):

const name = "Boots";
let score = 10;
score = 20;   // ok, because it's "let"

The words in "quotes" are a string β€” that's coder-speak for text. 🧡

Read the snippets in each question, then pick what you think the answer is. πŸ‘‡

After this code runs, what is inside the box color?

const color = "blue";

Which keyword makes a box you can change again later?

What is score at the end?

let score = 5;
score = score + 3;