if you always use the stored values, you will want to assign defaults to un-stored values, like are encountered in a first-run, or as you describe.
most "getSetting()"-type functions in other languages even give you a slot for defaults, but localStorage itself doesn't.
luckily, it's easy enough to do in js using the "default" operator (||), which used after a localStroage assignment, will be choosen if these is no saved setting, or if the saved one is blank for some reason:
var storedValue = localStorage.getItem('text');
or even simpler,
var storedValue = localStorage.getItem('text') || 0;
of course, you can default to anything besides 0, this is just how it looks in the source...
var storedValue = localStorage.text || 0;
bonus thought: you can even use defaults to hit or avoid function calls:
which asks the user if nothing is saved, and if the user cancels, defaults to 0.
var storedValue = localStorage.text || prompt("Enter Before Noon Value") || 0;
i wouldn't actually use prompt() on a public page, but it demos that you can do many defaults and default to a function call to do more complex things just-in-time if needed.