Last active
February 3, 2016 20:14
-
-
Save mlakkadshaw/6850250 to your computer and use it in GitHub Desktop.
Example of _.where clause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = [{model:"T", manufacturer: "ford"}, | |
{model:"S", manufacturer:"tesla"}, | |
{model:"r8", manufacturer:"audi"}, | |
{model:"fiesta", manufacturer:"ford"}]; | |
//Code to fetch all the ford cars | |
var fordCars = _.where(data, {manufacturer: "ford"}); | |
//output | |
[{model:"fiesta", manufacturer:"ford"},{model:"T", manufacturer: "ford"}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment