Do I want to delete a row of data in the localstorage cache?

1. I have a list, and when I swipe to delete it, I get the index, and call localStorage.removeItem (index).. The data in the cache cannot be deleted. Is there something wrong with my writing? I"m going to delete the option to 1 now. What do I do?

Jan.03,2022

The data in

localStorage is a key-value pair

list is its key

if you want to delete list, removeItem ('list')

delete the data inside getItem ('list') get the array and then set it

< hr >
function f(i){
    let list = localStorage.getItem('list');
    list.splice(i, 1);
    localStorage.setItem('list', list);
}

The

upstairs is basically correct, but localStorage can only store strings. A small change based on him

function f(i){
    var list = JSON.parse(localStorage.getItem('list'));
    list.splice(i, 1);
    localStorage.setItem('list', JSON.stringify(list));
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb95c1-471ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb95c1-471ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?