How to remove an element from array in local storage javascript code example
Example 1: remove local storage item
localStorage.removeItem(key);
Example 2: 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));