I need to merge several arrays into one json and add a value but I'm stuck.
I have this:
var areas = [];
areas[0] = [];
areas[1] = ["DE"];
areas[2] = ["PL","BE","FR",];
areas[3] = ["US"];
and I need this:
values: {
'DE': '#e6f2cc',
'US': '#e6f2cc',
},
So I need to merge the arrays and add "#e6f2cc" as a value to the key.
Is there a fast way to do that? I'm not a JS pro. I managed to merge it but I failed to add the value to this.
Thanks!