“LocalStorage.RemoveItem ()” Kod odpowiedzi

Usuń LocalStorage

localStorage.removeItem("key");
Itchy Ibis

JavaScript LocalStorage Clear Items

localStorage.clear();//this clears the localStorage completely
The Amateur

Usuń element z LocalStorage

localStorage.removeItem('key');
Envious Earthworm

LocalStorage Usuń element

localStorage.setItem('image', 'myCat.png');
...
localStorage.removeItem('image');
GutoTrosla

LocalStorage.RemoveItem ()

// 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));
Skillup

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu