我正在尝试从localStorage数组中删除一个值。我要删除的值是30
localStorage值:["70","30"]
var items = JSON.parse(localStorage["favorite"]);
for (var i =0; i< items.length; i++) {
var item = JSON.parse(items[i]);
if (item == 30) {
items.slice(i);
break;
}
}
localStorage.setItem("favorite", items);