Sets or deletes a value in the active storage mechanism across any runtime environment. Automatically serializes objects for safe storage.
The storage key to set
Optional
The value to store (if undefined, the key is deleted)
setStorage('user', { name: 'Alice' });setStorage('user', undefined); // deletes 'user' Copy
setStorage('user', { name: 'Alice' });setStorage('user', undefined); // deletes 'user'
Sets or deletes a value in the active storage mechanism across any runtime environment. Automatically serializes objects for safe storage.