function scoped() {
var a = 150;
let b = 300;
const c = 500;
}
a = 300; // Why is it possible to access a function scoped variable?
b = 600; // Same as above
c = 1000; // Same as above and also why I can change value of constant?
console.log(a); // Return: 300 - Why it works?
console.log(b); // Return: 600 - Why it works?
console.log(c); // Return: 1000 - Why it works?
我的问题:
为什么可以(在非严格模式下)访问函数作用域变量?这不应该被允许吗?
为什么我什至可以更改常量的值?
在这种特定情况下,示波器或吊装如何在幕后工作?