任何人都可以解释下面的代码如何在JavaScript或任何其他编程语言中工作。
以下引用称为什么。
var a=5;
var a=b;
b=10;
console.log(a);
console.log(b);
10 // value of a returned
10 // value of b returned
或者
var a=5, b;
var a=b;
b=10;
console.log(a);
console.log(b);
两者都返回值为10。为什么将a的值赋给10,如何赋值?
这将永远行不通。
它将显示b
未在javascript中定义。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句