const x = '__storage_test__'; storage.setItem(x, x); storage.removeItem(x); code example Example: localstorage clear item localStorage.removeItem(key);