localStorage

What is localStorage

Key-value storage for a browser that persists forever.

Each domain has their own storage.

localStorage is attached on the global window.

You can view the local storage under Application tab in the developer tools or just typing localStorage in the browser console.

Local and session storages are identical, but with different lifespan.

Clearing

// remove a specific localStorage object localStorage.removeItem("variable_name"); // clear all localStorage object window.localStorage.clear();