I've stumpled into a problem regarding localStorage. My code looks like this:
var defaultReportData = {
'station': 'DR P3',
'days': 'Mon, Tue, Wed, Thur, Fri',
'startHour': '06:00',
'endHour': '18:00',
'demography': 'Cover: All'
}
localStorage.setItem('defaultReportData', JSON.stringify(defaultReportData));
// Returns null
console.log(localStorage.getItem('station'));
Whenever I just type out "localStorage" in my console after loading the page, the object gets output correctly. However, the localStorage output returns null in my console when I want to get a specific value.
What am I doing wrong?