Last active
December 20, 2019 10:47
-
-
Save kevinchisholm/b856b209e30ca09e1231c5605a478db3 to your computer and use it in GitHub Desktop.
lodash.find example 1
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
const cars = [ | |
{ name: 'Mustang', maker: 'Ford', isSuv: false }, | |
{ name: 'EcoSport', maker: 'Ford', isSuv: true }, | |
{ name: 'CR-V', maker: 'Honda', isSuv: true } | |
]; | |
const match = _.find(cars, car => { return car.name === 'Mustang'; }); | |
console.log(match); // {name: "Mustang", maker: "Ford", isSuv: false} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment