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.
let temperature = 18;
const morningTemperature = temperature;
temperature = 22;
console.log(morningTemperature); // outputs 18Predict 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);