I cannot delete an item that is in the localStorage. I created a table to store the added items. I want to delete an article by its index or if possible by its id. thank you for help
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))
}