I am looking for best ways of doing this. I have two arrays:
key = [1,2,3]; value = [\'value1\', \'value2\', \'value3\']
The end result I
Here's what you need
_.zipObject(key, value);
Actually ... no.
Pure Javascript can though:
var result = key.map(function(val, index){ return { key: val, value: value[index] }; });