1. Home
  2. Javascript
  3. Localstorage object

Used for storing key value pairs in the browser and can be accessed through a window property.

window.localStorage // returns Storage object 

window.localStorage.setItem('counter', 1) // set key value pair

window.localStorage.getItem('counter') // returns "1"

window.localStorage.clear // clears all data in the Storage object
Full Javascript cheatsheet
Sitemap Git repository