I’m struggling to edit an array stored in LocalStorage. I have prior functions that take the DIVs with their unique ID’s and add them as such: localStorage.setItem(“deleted_items”,JSON.stringify(items));
I then have a click function gets the id of the div and store it in a variable as with this example:
function getChat(input){
let id = $(input).attr('id');
console.log("Captured ID = " + id); //Returns 27615035196
}
From this, I then also store the items from LocalStorage in a variable
let hiddenItems = JSON.parse(localStorage.getItem("deleted_items"));
I then want to get the index of that item in the array:
const itemIndex = hiddenItems.indexOf();
And then finally with that index, splice the array to remove the item and update it again. But can’t seem to get the last piece of the puzzle here as my itemIndex is returning as -1