Created
May 19, 2020 19:33
-
-
Save thauber/20212daf6c2a0c562557cdd23116e990 to your computer and use it in GitHub Desktop.
This file contains 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 info = _.reduce(list (memo, item) => { | |
if (item.data > memo.max.data) memo.max = item | |
if (item.data < memo.min.data) memo.min = item | |
return memo | |
}) | |
console.log(infom.max) // item with max .data | |
console.log(info.min) //item with min .data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment