I know Temporal dead zone in es6. But I was confused about the procedure of the following code.
Javascript is a kind of Interpretive language.How does it knows there is a s will be declared in this block behind rather than use the s outside this block.
In an other word , what is the procedure of the following code ?? I am new here, please help me.
'use strict'
var s = 1;
if (true){
console.log(s);
console.log("AAA");
let s = 2;
}