Categories
Mastering Development

How do you only map portion of index? reactjs

This is my code below I want to only map data upto where index is equal to 10. How do I change my code? My reactjs code looks like below: {ranks.map((i, index) => ( <div key={index}> {index} </div> ))} I want to only display my result upto where index is equal to 10