JavaScript for Real

Lesson 1 · zap JavaScript for Real

Values, References, Types

Predict when copying an object copies the data.

Before you start

Primitives (string, number, boolean, null, undefined, symbol, bigint) are copied by value. Objects and arrays are copied by reference — two variables can point at the same thing. Most 'why did that change?' bugs are this.

5 exercises·up to 87 XP·5/5 hearts