Created
August 30, 2017 14:23
-
-
Save aherve/ede5d6d0ad8a7ba8be93b842a52a38ba 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
// remove object from array by property | |
const removeId = 3 | |
const without3 = initial.filter(x => x.id !== removeId) | |
console.log(without3) // => [ { id: 1, score: 1 }, { id: 2, score: 2 } ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment