I have this code
{categories.map((category, index) => {
return(
<option value={category._id} key={index}>{category.name}</option>
)
})}
This code display all categories. And I have const product
How to make if product.category == category._id
add attribute selected to select( in map function )