I have a problem, here I use the selectpicker
plugin from Bootstrap
to select more than one, here I want to make a modal edit where it retrieves data from the previous data, which is a matter of previous data in the form of an array of how I set the value in the selectpicker
this is my response data
0: {some data}
1: {some data}
2: Array(2)
0: "6"
1: "18"
How do i set the value in selectpicker
with data from index array 2
this my HTML
<select class="selectpicker" name="loan_duration[]" id="loan_duration" class="form-control" multiple>
<option value="6">6</option>
<option value="9">9</option>
<option value="12">12</option>
<option value="15">15</option>
<option value="18">18</option>
<option value="21">21</option>
<option value="24">24</option>
</select>