Making Web apps with HTML5 and LocalStorage – Part 1
localStorage sets fields on the domain. Even when you close the browser, reopen it, and go back to the site, it remembers all fields in localStorage.
var foo = localStorage.getItem("bar"); // ... localStorage.setItem("bar", foo);
…could be rewritten to use square bracket syntax instead:
var foo = localStorage["bar"]; // ... localStorage["bar"] = foo;