Remove array item from localstorage

Instead of deleting the key, just set it again with the new questions array:

questions.splice(index, 1);
localStorage.setItem('questions', JSON.stringify(questions));

Leave a Comment