Created
September 20, 2018 08:44
-
-
Save Lodo4ka/4ad739776e257213a2b8d69aaa47d2b8 to your computer and use it in GitHub Desktop.
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 pushUniqueObject(...arrays) { | |
let result = []; | |
let uniqueId = []; | |
for(let array of arrays) { | |
if(array.length !== 0) { | |
for (let object of array) { | |
if(object.child_id !== undefined && !uniqueId[object.child_id]) { | |
uniqueId[object.child_id] = true; | |
result.push(object); | |
} | |
} | |
} | |
} | |
return result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment