javascript clear localstorage
snippet in javascript

js remove all local storage

user1099

window.localStorage.clear(); //clear all localstorage
window.localStorage.removeItem("my_item_key"); //remove one item

javascript clear localstorage

user9540

window.localStorage.clear(); //clear all localstorage
window.localStorage.removeItem("my_item_key"); //remove one item

delete local storage javascript

user9448

localStorage.removeItem(key);