Array#splice sparse array spec question.

John-David Dalton john.david.dalton at gmail.com
Mon Apr 9 08:19:48 PDT 2012


Can someone confirm/reject that by spec (http://es5.github.com/#x15.4.4.12):

// sparse array ;D
var a=[0];
a[2]=2;

// the resulting arrays length should be 1 and not 2
console.log(a.splice(0, 2).length);

I'm seeing `2` in latest Chrome/FF.

Thanks,
-JDD


More information about the es-discuss mailing list