title: How to get first N number of elements from an array
body: <p>I am working with Javascript(ES6) /FaceBook react and trying to get the first 3 elements of an array that varies in size. I would like do the equivalent of Linq take(n).</p>
  
  <p>In my Jsx file I have  the following:</p>
  
  <pre><code>var items = list.map(i =&gt; {
    return (
      &lt;myview item={i} key={i.id} /&gt;
    );
  });
  </code></pre>
  
  <p>Then to get the first 3 items I tried</p>
  
  <pre><code>  var map = new Map(list);
      map.size = 3;
      var items = map(i =&gt; {
        return (&lt;SpotlightLandingGlobalInboxItem item={i} key={i.id} /&gt;);
      });
  </code></pre>
  
  <p>This didn't work  as map doesn't have a set function.</p>
  
  <p>Can you please help?</p>