I have two strings, one a key and one a value, which I would like to turn into an object and concatenate in a loop. For example:
var data = {};
// loop starts here
var a_key = 'element';
var a_val = 'value';
var a_obj = // somehow this equals { "element":"value" }
data = data.concat(a_obj);
// loop ends here
I'm just not sure how to create an object from those two strings! Any help appreciated