Codington
0 of 8 problems solved • 0%

Exercise prompt

Predict a Copied Value

Assigning a number from one variable to another copies its current value. If the first variable changes later, the copied number does not change with it.

Example

let temperature = 18; const morningTemperature = temperature; temperature = 22; console.log(morningTemperature); // outputs 18

Predict the output

A scoreboard stores a snapshot before the score changes. Predict the displayed snapshot.

let originalScore = 10; const displayedScore = originalScore; originalScore = 15; console.log("Displayed:", displayedScore);
What will this code print?