window name
2022年5月1日小于 1 分钟
window name
Question
What does the code snippet to the right output by console.log
?
Snippet
var a = 1;
(function() {
console.log(a + this.a);
var a = '2'
console.log(a + this.a);
})();
var name = 1;
(function() {
console.log(name + this.name);
var name = '2'
console.log(name + this.name);
})();