JSFiddle - React, Tailwind, and code Playground

by rajke88

HTML

<select id="sselect"></select>

JavaScript

var a = [1,2,2,3,4,5];
var duplicates = a;
var result = [];
$(function() {
    for ( var i = 0; i < a.length; i++) {
       var item = a[i];
    for ( var c = 0; c < duplicates.length; c++) {
          if (jQuery.inArray(item, result) == -1) {
         result.push(item);
        }
    }
}
});

for ( var i = 0; i < result.length; i++) {
 $('#sselect').append($('<option>', { 
        value: result[i],
        text : result[i] 
    }));
}