Created
June 27, 2017 18:18
-
-
Save jgimbel/b2abd5b38c5f930f513867aa2b352508 to your computer and use it in GitHub Desktop.
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
function unique(arr, func) { | |
const uniques = arr.reduce((o, k) => func(k) in o ? o : Object.assign(o, {[func(k)]: k}), {}) | |
return Object.keys(uniques).map(k => uniques[k]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment