split array and join to make it an object es6 code example
Example 1: javascript explode
//split into array of strings.
var str = "Well, how, are , we , doing, today";
var res = str.split(",");
Example 2: join array javascript
<html>
<select multiple class="select-colors">
<option>blue</option>
<option>green</option>
</select>
</html>
<script>
var myColorSelect = $(".select-colors").val().join();
console.log(myColorSelect);
</script>