Getting Started with JavaScript for Web Development

Storing to LocalStorage

https://developer.mozilla.org/en-US/docs/Web/API/Storage/LocalStorage

LocalStorage allows us to save information to the browser itself. This let's us persist data for our users without having to make a trip to an actual database.

Using LocalStorage

// save to localStorage
localStorage.setItem('username', 'chris');

// get data from localStorage
localStorage.getItem('username');