localStorage is a special object within JavaScript that allows you to store variables inside of the users browser in a way that allows them to persist across pages and across sessions (meaning a user can leave the web site, or even close their browser entirely, and when they return the localStorage variables will still be accessable).
- localStorage.length: a property that displays the number of variables being stored.
- localStorage.setItem(name, value): a method used to save a variable in a key:value pair.
- localStorage.getItem(name): a method to retrieve a saved variable by its name.
- localStorage.removeItem(name): a method that removes a specific variable by its name.
- localStorage.clear(): a method that empties all variables inside of localStorage.
- localStorage.key(i): a method that returns the name of the property at the index provided.