Skip to content

Instantly share code, notes, and snippets.

@numfin
Created July 20, 2018 12:21
Show Gist options
  • Save numfin/bd29c80ac016aff5a476acb4e57d1ea0 to your computer and use it in GitHub Desktop.
Save numfin/bd29c80ac016aff5a476acb4e57d1ea0 to your computer and use it in GitHub Desktop.
let counter = 0;
const postIds = postsToDelete.map(val => val.getIdFromVal)
allPosts.forEach((val, index) => {
if (postsIds.contains(val.keyToCurrentPostId)){
allPosts.splice(index - counter, 1);
counter++;
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment