I have a problem with a local scope. The second console.log doesn't show "a" value, but shows undefined. Why so?
"use strict"
console.log(a); //undefined
var a = "a";
function b(){
console.log(a); // why is undefined here?
var a = "a1";
console.log(a); // here is "a1"
}
b();