Answers for "How to remove an element from array in local storage javascript"

5

remove array item from localStorage

// Don't use removeItem() that as the name says removes the whole item from localStorage. Just do another setItem() to overwrite the old data.
questions.splice(index, 1);
localStorage.setItem('questions',JSON.stringify(questions));
Posted by: Guest on March-10-2020
0

remove local storage item

localStorage.removeItem(key);
Posted by: Guest on April-27-2020

Code answers related to "How to remove an element from array in local storage javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language