var ccas = 12;
function ff() {
var a;
console.log(arguments.length);//0
console.log(arguments[0]);//undefine;
console.log(arguments.length > 0);//false
console.log(a = arguments.length > 0 && 1);//false
console.log(arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ccas);//12
var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ccas;//12
return function () {
console.log(arguments.length);
var ccas = 7;
console.log(y);
}.apply(null, arguments);
}
ff();
为什么y的值是12,求大神告知
肥皂起泡泡
相关分类