I bring in data from a spreadsheet into my html/javascript in an array that has multiple columns and rows. I then want to split this up into multiple smaller arrays as needed.
One of the columns has duplicates and for my purposes I need an array output of unique values. Other solutions cover only simple arrays, i.e., [1,2,3,4]
This works:
const newArray = [...new Set(array)];
This does not:
const newArray = [...new Set(array.column)];
Alternatively, since "this likely won't work if the array has object values," could I take the array.column and make it a seperate array and then apply const newArray = [...new Set(array)];?
for(var i = 0; i < array.length; i++) {
dropdown[dropdown.length] = new Option(array[i].column,array[i].column)
}