title: Javascript local storage. Get only first 3 elements?
body: <p>Getting and returning elements from local storage to be displayed is simple:</p>
  
  <pre><code>let element = JSON.parse(localStorage.getItem('element'));
  return element.elements
  </code></pre>
  
  <p>Assuming element is the key and elements are a bunch of elements in the key.</p>
  
  <p>But, how would I get only the first 3 elements?</p>
  
  <p>I currently have this (but I think there will be a better way to do it):</p>
  
  <pre><code>let firstelement = element.elements[0];
  let secondelement = element.elements[1];
  let thirdelement = element.elements[2];
  </code></pre>
  
  <p>I'm not sure what to do after this.</p>