Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #array #item #localStorage
ADD COMMENT
Topic
Name
7+3 =