Last active
September 17, 2015 04:58
-
-
Save bradurani/45ead05eda8907338f33 to your computer and use it in GitHub Desktop.
Before Function Injection
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
function tacoRank(t){ | |
... | |
} | |
function findBestTacos(restaurants) { | |
return restaurants.reduce((acc, next) => { return acc.concat(next.tacos) }, []) | |
.sort((a, b) => { tacoRank(a) - tacoRank(b) }) | |
.slice(0, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment