jashkenas/underscore

_.values broken on large objects? (that contain `length` key, dup of #148)

DTrejo opened this issue · 3 comments

http://jsfiddle.net/TjA5E/3/

This code does not work.

Notice that it does work for the second and third examples.

I have no idea why this is happening :|
-David

I think it may be the length property tricking _.map.

e.g.
console.log('this doesnt work:');
var data = {"a":2.0, "b":3.0, "c":4.0, "�":0.00012251375747504177, length:0.2};
console.log(_.values(data));

Yep, you're correct! _.map() delegates to _.each(); see issue #148.

I think this should go in the documentation, as mentioned in #148.