Web storage API to store and retrieve data in browsers, localStorage stores data even when browser is closed, has no expiraion date.
function populateStorage() {
localStorage.setItem("1", "1");
localStorage.setItem("2", "2");
localStorage.setItem("3", "3");
return localStorage.length; // Should return 3
}
Returns the number of items stored in storage object.