I'm writing a small game in Javascript. So far everything works perfectly, except I have no idea how localStorage works. I've looked everywhere for a decent explanation but everything is going way over my head.
I have an object and a number of variables that I want to store, all numbers.
land = {
total:150000000,
owned:1,
cost: 110,
housing: 14
};
As well as these variables,
var seconds = 0;
var minutes = 0;
var hours = 0;
var days = 0;
var years = 0;
Can anyone please point me in the right direction on how to save and load these objects/variables from localStorage?! Any help at all is greatly appreciated.