I am working with Javascript (ES6) / FaceBook and trying to get the first 3 elements of an array that vary in size. I would like to make the equivalent of Linq take (n).
In my Jsx file, I have the following:
var items = list.map(i => { return ( <myview item={i} key={i.id} /> ); });
Then, to get the first 3 elements, I tried
var map = new Map(list); map.size = 3; var items = map(i => { return (<SpotlightLandingGlobalInboxItem item={i} key={i.id} />); });
This did not work, since the card does not have a given function.
Can you help?
javascript reactjs
user1526912 Jan 19 '16 at 17:19 2016-01-19 17:19
source share