I am facing an issue while trying to remove an item from localStorage. I have created a table to store all the added items, and I would like to delete a specific article either by its index or ideally by its unique id. Your assistance is greatly appreciated. Thank you in advance.
deleteOption(){
this.test = JSON.parse(localStorage.getItem('test'))
this.test.splice(index, 1)
},
test:[
{
id:1,
item: test item 1
},
{
id:2,
item: test item 2
},
{
id:3,
item: test item 3
},
]
addItem () {
localStorage.setItem("test",JSON.stringify(this.test))
}