How do I write this?
chatBox_array.push({key:val_d65f});
They 'key', somehow gets to just "key":value, for objects instead of the value inside the key. It becomes sometime like the following.
0: Object
key: "false"
__proto__: Object
1: Object
key: "blue"
__proto__: Object
Here's the full code.
var chatBox_vars = [{'return_url':chatBox_return_url},{'base_color':chatBox_base_color},
{'mid_color':chatBox_mid_color},
{'init_open':chatBox_init_open},
{'init_open':chatBox_mx_logo},
{'welcome_msg':chatBox_welcome_msg},
{'clientid':chatBox_clientid}];
var chatBox_array = [];
for (var i=chatBox_vars.length;i--;){
var item_6dds3=chatBox_vars[i];
for (var key in item_6dds3) {
if (Object.prototype.hasOwnProperty.call(item_6dds3, key)) {
var val_d65f = item_6dds3[key];
if (val_d65f == null || val_d65f == 'undefined' || val_d65f == ''){} else {
console.log(key);
chatBox_array.push({key:val_d65f});
}
}
}
}