Could someone help me with this javascript. I have two variables, with commaseparated words.
var names = "Verwerkende industrie, Retail, Primaire producent, Out of home, Groothandel, Grondstof, Consument, Bewerkende industrie";
var numbers = "9, 3, 4, 2, 7, 9, 3, 2";
I would like to combine them into an array that should end up looking like this
var combined = [
['Verwerkende industrie', 9],
['Retail', 3],
['Primaire producent', 4],
['Out of home', 2],
['Groothandel', 7],
['Grondstof', 9],
['Consument', 3],
['Bewerkende industrie', 2]
];
numbersis not valid Javascript syntax. Is it supposed to be an array? Or a string likenames? Also, are you sure you wouldn't rather have an array of objects than an array of arrays?