私はこれをFirefox-3.5.7/Firebug-1.5.3とFirefox-3.6.16/Firebug-1.6.2で観察しました。
Firebugを起動すると:
var x = new Array(3)
console.log(x)
// [undefined, undefined, undefined]
var y = [undefined, undefined, undefined]
console.log(y)
// [undefined, undefined, undefined]
console.log( x.constructor == y.constructor) // true
console.log(
x.map(function() { return 0; })
)
// [undefined, undefined, undefined]
console.log(
y.map(function() { return 0; })
)
// [0, 0, 0]
何が起きてる?これはバグですか、それとも使い方を誤解していますnew Array(3)
か?