Created
December 9, 2019 17:40
-
-
Save johnhutchins/554bd4b75bc6afd4cc3ad588b7d199c4 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 removeDuplicatetElevations(arr){ | |
console.log("NON FILTERED === ", arr) | |
const filteredArr = arr.reduce((acc, current) => { | |
const x = acc.find(item => item['height'] === current['height']); | |
if (!x) { | |
return acc.concat([current]); | |
} else { | |
return acc; | |
} | |
}, []); | |
console.log('FILTERED === ',filteredArr) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment