Answers for "How to clear localStorage when browser/tab is closing"

1

How to clear localStorage when browser/tab is closing

window.addEventListener("beforeunload", () => localStorage.removeItem('storageVariable'));
Posted by: Guest on July-25-2020

Code answers related to "How to clear localStorage when browser/tab is closing"

Code answers related to "Javascript"

Browse Popular Code Answers by Language