I have variable and loop inside like this:
var htmlmask = `
<table>
<tr>
<td>種類</td>
<td>
<div class="form-element maskselectop">
<select class="form-element">
${masktypes.map((masktype, i)=>{
let option = '';
return option = `<option value="${masktype}" ${(i === 0) ? 'selected' : ''}>${masktype}</option>`;
})}
</select>
</div>
</td>
</tr>
</table>`;
$('body').html(htmlmask);
Can you tell me why the comma
appears between option
after return?
What wrong with my syntax?