var retrievedObject = localStorage.removeItem('fakeUsers'); code example Example: localstorage clear item localStorage.removeItem(key);