Last active
January 5, 2022 14:22
-
-
Save onosendi/1b10433f988ba72a07ffc73250514d0c 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 myDict = [{ index: 1, area: 1 }, { index: 9, area: 9 }, { index: 2, area: 2 }]; | |
const z = myDict.reduce((acc, item) => item.area > (acc?.area ?? Infinity) ? item: acc); | |
console.log(z); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment