📜  从 localStorage 中删除数组项 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:14.738000             🧑  作者: Mango

代码示例1
// 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));