Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Jarrett Horton jghorton14

🎯
Focusing
Block or report user

Report or block jghorton14

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lmfresneda
lmfresneda / remove_duplicates.js
Last active Aug 23, 2019
Remove duplicates from an array of objects in javascript
View remove_duplicates.js
// FUN METHOD
/**
* Remove duplicates from an array of objects in javascript
* @param arr - Array of objects
* @param prop - Property of each object to compare
* @returns {Array}
*/
function removeDuplicates( arr, prop ) {
let obj = {};
return Object.keys(arr.reduce((prev, next) => {
You can’t perform that action at this time.