I am trying to display the values of an array in <option> tag in react js. So far I have failed.
<select>
{
op.map(value => (<option key={value} value={value}>{value}</option>))
}
</select>
op is an array. op = 1,2,3. I got the array op like this:
for (let i=0; i<Math.ceil(response.data.length/end); i++) {
op[i] = i+1;
}
When I inspect is see only this:
<select></select>
oparray after the for loop to check if it has values indeed?