Reassign a value to a variable (2)

The code below first declares a variable named num with value 1. Then, a new value 2 is assigned. Finally, the variable is logged.
But, the code will not work like that. Find the mistake and fix it. Execute the corrected code.
const num = 1;
num = 2; console.log(num);
Javascript
Console