Closed Ice-Hazymoon closed 5 years ago
window.i = 1 console.log(i) let i = 2 console.log(i) // Uncaught ReferenceError: Cannot access 'i' before initialization at <anonymous>:1:3
You have to re-write your code you used the variable i and then defined it define it first then use it.
let i = 2 window.i = 1 console.log(i)