Instead of deleting the key, just set it again with the new questions array:
questions.splice(index, 1);
localStorage.setItem('questions', JSON.stringify(questions));
More Related Contents:
- how to store new elements added in webpage by user? [closed]
- What is the max size of localStorage values?
- How do I store an array in localStorage? [duplicate]
- use localStorage across subdomains
- Is it safe to store a JWT in localStorage with ReactJS?
- Get HTML5 localStorage keys
- How to delete a localStorage item when the browser window/tab is closed?
- How persistent is localStorage?
- window.localStorage vs chrome.storage.local
- How to use Local storage in Angular [duplicate]
- Is localStorage.getItem(‘item’) better than localStorage.item or localStorage[‘item’]?
- HTML5 Local Storage fallback solutions [closed]
- Scope of sessionStorage and localStorage
- Calculating usage of localStorage space
- How to mock localStorage in JavaScript unit tests?
- Accessing localStorage from a webWorker
- Is it possible to use any HTML5 fanciness to export local storage to Excel?
- Javascript/HTML Storage Options Under File Protocol (file://)
- How can I serialize a function in JavaScript?
- How to retrieve all localStorage items without knowing the keys in advance?
- Javascript + HTML5 localstorage [closed]
- Can you use HTML5 local storage to store a file? If not, how?
- How to store objects in HTML5 localStorage/sessionStorage
- localStorage – use getItem/setItem functions or access object directly?
- JavaScript localStorage object broken in IE11 on Windows 7
- Best way to store small UI user preferences in web app? [closed]
- How can I request an increase to the HTML5 localstorage size on iPad, like the FT web app does?
- Listen for changes with localStorage on the same window
- Store an array with chrome.storage.local
- Why do two web pages have different localStorage? How can I fix this?