Web APIs

StorageEvent.key

Try the free JavaScript compiler

Name of the changed storage key, or null for a clear operation. Synthetic construction tests handler data only, not actual delivery across tabs.

Formal Syntax & Structure

javascript syntaxjavascript
event.key

Return Value

string | null

Changed key or null for clear.

Working Example

Example Snippetjavascript
const e=new StorageEvent("storage",{key:"theme",oldValue:"light",newValue:"dark"});console.log(e.key,e.oldValue,e.newValue);
JavaScript Reference