Closed detarmstrong closed 7 years ago
Thanks for your interest in contributing! The intent of this project is to be a port of Underscore.js, so each method should function the same. In Underscore.js, does findWhere() function the same as the modified version?
Yes, this fiddle demonstrates how all key-value pairs must match to return a result : http://jsfiddle.net/BwHxv/702/
Ah, yeah, this makes sense. The old logic was always returning the first item in the list. The findWhere
tests each expected the first element, which is why this went unnoticed for so long. Thanks for the fix, good catch!
Note: the existing broken tests are caused by an unrelated issue, so I'm going to merge this in.
I noticed findWhere wasn't living up to it's documented behavior to "Looks through the collection and returns the first value that matches all of the key-value pairs listed in properties." and was instead returning the first struct that matched any of the key value pairs listed in properties. This should fix that.