Last active
June 19, 2020 05:35
-
-
Save geomago/8f7b91750cdc3af092a5e3bd6280c3db to your computer and use it in GitHub Desktop.
find_car
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
| let car = cars.reduce(function(prev, current) { | |
| return prev.price < current.price ? current:prev; | |
| }, {price:0}); | |
| // RESULT IS: | |
| { | |
| id: 4, | |
| make: "Bugatti", | |
| model: "Chiron Pur Sport", | |
| price: 3000000, | |
| colour: "blue" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment