Const
Clears data from browser storage (localStorage or sessionStorage).
If key is provided, removes only that key. If key is omitted, clears all storage.
key
Operation data with storage properties erased
// Clear specific keyconst result = clearStorage({ key: 'user-settings', storageType: 'local'}); Copy
// Clear specific keyconst result = clearStorage({ key: 'user-settings', storageType: 'local'});
// Clear all localStorageconst result = clearStorage({ storageType: 'local'}); Copy
// Clear all localStorageconst result = clearStorage({ storageType: 'local'});
Clears data from browser storage (localStorage or sessionStorage).
If
keyis provided, removes only that key. Ifkeyis omitted, clears all storage.