Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created December 11, 2020 05:12
Show Gist options
  • Save debugmodedotnet/ffc4744503804aac4bf5484b85a0c8ef to your computer and use it in GitHub Desktop.
Save debugmodedotnet/ffc4744503804aac4bf5484b85a0c8ef to your computer and use it in GitHub Desktop.
let c1 = data.findIndex( t => Object.keys(t)[0] == d.type);
if(c1 > -1){
if(data[c1][d.type].length >1){
const index = data[c1][d.type].indexOf(d.title);
if (index > -1) {
data[c1][d.type].splice(index, 1);
}
}
else{
const index = data[c1][d.type].indexOf(d.title);
if (index > -1) {
data.splice(c1,1)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment