It appears that the first example(看来第一个例子)
x = new Array(3);
Creates an array with undefined pointers.(用未定义的指针创建一个数组。)
And the second creates an array with pointers to 3 undefined objects, in this case the pointers them self are NOT undefined, only the objects they point to.(第二个对象创建一个带有指向3个未定义对象的指针的数组,在这种情况下,它们本身的指针不是未定义的,只有它们指向的对象才是未定义的。)
y = [undefined, undefined, undefined]
// The following is not equivalent to the above, it's the same as new Array(3)
y = [,,,];
As map is run in the context of the objects in the array I believe the first map fails to run the function at all while the second manages to run.(由于map是在数组中对象的上下文中运行的,因此我相信第一个map根本无法运行该函数,而第二个map可以运行。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…