为什么
var x = 1; function foo(x = x) { // ... } foo() //x is not defined
会报错,而
var x = 1; function f(y = x) { console.log(y); } f() //1
就能得出结果1呢
小郎Lie
Caballarii
相关分类