Created
December 11, 2020 05:12
-
-
Save debugmodedotnet/ffc4744503804aac4bf5484b85a0c8ef 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
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