← JavaScript Essentials
JavaScript foundations · 15 MIN

Variables and values

Variables and values

Use const by default when a binding will not be reassigned and let when it will. JavaScript has primitive values such as string, number, bigint, boolean, undefined, null and symbol, plus objects. Variable names should describe their purpose.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

const learner = "Ada";
let score = 0;
score += 10;
console.log(learner, score);