in underscore source code, after applying shift or splice on an array and in case the length of the array is zero :
if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
any idea why still need to do this : delete obj[0]
Searching around in the Issue tracker shows that my assumption was right, it is just a fix for an IE bug.
IE bugs with splice() and shift():
jdalton commented on 6 Dec 2011
IE bugs with splice() and shift(), failing to remove the 0 indexed value, when using an array-like-object with _(...).
IE compatibility mode and IE < 9 have buggy Array shift() and splice() functions that fail to remove the last element, object[0], of array-like-objects even though the length property is set to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With