My question is regarding how to iterate partially through an array in React JSX. Instead of calling .map and iterating through all the items in profile.categories, I only want to display the first five items in the array. I currently have the following code:
<div className="categories">
   {profile.categories.map(category => (
       <div
         className="profile-categories"
         style={{ float: "left" }}
       >
         {category}
       </div>
     ))}
 </div>
 
     
    