Basics of Localstorage

Basics commands

i think these three are the main ones to use.

  • localStorage.setItem()
  • localStorage.getItem()
  • localStorage.removeItem()

Examples of setting data into local storage

  • localStorage.setItem(key, value)
  • localStorage.setItem(“this title”, “this is data”)
  • localStorage.setItem(“title”, “title data”)

Using instead of using a cookie and storing data on the client side and checking the data when the page loads to make decisions about the page.

How to i go about remove the data from local storage?

  • localStorage.removeItem(key);
  • localStorage.removeItem(“title”)

Checking that you can store and get data through the command line.

setting item
getting item
video of using console log with localstorage

Recent Posts