Frequently you will need to take information that a user types in a form and save that in a JavaScript object to be used later.
This tutorial explains exactly how that would work as well as how to put that information into localStorage.
Code GIST: https://gist.github.com/prof3ssorSt3v...