title: localStorage getItem logs[object Object]
body: <p>I am trying to set and get items from local storage but when i log the data i get [object Object]</p>
  
  <p>i am trying to get the view of that object something like this {a : v, b : v }...</p>
  
  <p>here is the code :</p>
  
  <pre><code>var widgets = localStorage.getItem('widgets');
          if (widgets == null) {
           widgets = {
              widget_lot : '',
              widget_td : '',
              widget_cwo : '',
              widget_vehicles : '',
              widget_take : ''
              };  
  
              widgets.widget_lot = 0;
              widgets.widget_td = 0;
              widgets.widget_cwo = 1;
              widgets.widget_vehicles = 0;
              widgets.widget_take = 0;
  
              localStorage.setItem('widgets', widgets);
          }
  
          console.log(widgets); //Logs "[object Object]"
  </code></pre>