Re:iOS 8 length bug breaks jQuery and Underscore object iter...
by joeframbach on Tuesday March 31, 2015 @11:22PM
(#9301333)
The workaround in the article was:
But I actually would have failed this in code review:
and replaced it with:
because although mapping over objects is "normal", it has never been 100%.
[ Parent
| on HN ]
Re:iOS 8 length bug breaks jQuery and Underscore object iter...
by wging on Tuesday March 31, 2015 @11:38PM
(#9301381)
Why not instead do
_.map(_.values(thingsGroupedById), function(thing) {
// operate on thing
}
Then there's no need to do the property access yourself.Chaining makes this even nicer:
_(thingsGroupedById).values().map(function(thing) {
}
Re:iOS 8 length bug breaks jQuery and Underscore object iter...
by dandelany on Wednesday April 01, 2015 @01:40AM
(#9301827)
Depends on what //... is. You might need the key for something, and you can get the value from the key but not vice versa.