I am trying to figure out a way to take the first 5 items out of an array of 80 and put them into an unordered list. I am mapping the data like this but not sure how to only collect the first 5 results. <ul>{data.moves.map((item) => (<li key={index}>{item.move.name} </li>))</ul>
I also tried instead of passing the entire array through the map to slice the first 5 off but I could not get that to work for me.
Any thoughts? Thanks!