Created
July 18, 2019 18:22
-
-
Save matthewoestreich/3e0a5e63ba55c1477a96b5b7df624e52 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 getDistinctObjectsBasedUponPropertyValue(array, distinctProperty) { | |
var tempArray = [] | |
return array.filter(function (n) { | |
return tempArray.indexOf(n[distinctProperty]) == -1 && tempArray.push(n[distinctProperty]) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment