Skip to content

Instantly share code, notes, and snippets.

@tofusoup429
Last active October 18, 2020 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tofusoup429/5ea4a52966e3bde6e73ae9d0f0293396 to your computer and use it in GitHub Desktop.
Save tofusoup429/5ea4a52966e3bde6e73ae9d0f0293396 to your computer and use it in GitHub Desktop.
let dataFetchedFromRemoteForCompanyInfo = {
name:"ABC corp",
address: "4090 Shady Pines Drive Independence VA",
postalCode: 24348
}
let dataFetchedFromRemoteForUserInfo = {
name:"ABC corp",
title: "manager",
}
localStorage.setItem('companyInfo', JSON.stringify(dataFetchedFromRemoteForCompanyInfo))
localStorage.setItem('userInfo', JSON.stringify(dataFetchedFromRemoteForUserInfo));
localStorage.removeItem('companyInfo'); //remove only 'companyInfo' key-value
localStorage.clear() //remove all key-value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment