Loading workspace environment...
Follow the journey of code from characters typed on your keyboard to CPU execution.
let memoryBox = 10;
console.log("Initial state in memory:", memoryBox);
memoryBox = memoryBox + 5;
console.log("After adding 5:", memoryBox);
memoryBox = memoryBox * 2;
console.log("After doubling:", memoryBox);Initial state in memory: 10
After adding 5: 15
After doubling: 30let memoryBox = 10;Allocates memory for a box named memoryBox and places 10 inside.memoryBox = memoryBox + 5;Reads 10 from memory, adds 5 to get 15, and writes 15 back to memoryBox.let x = 5;
x + 5;
console.log(x);let x = 5;
x = x + 5;
console.log(x);Architectural Explanation: Doing `x + 5` calculates 10 in the CPU, but throws the result away because it was never saved back into `x` with an assignment operator (`=`).
let score = 50;
score = score + 10;
score = score - 5;
console.log(score);Start a counter at 100. Subtract 25, then divide by 3. Print the final result.