What is the best way to reorganize array into output? I need to merge all value keys (whether array or not) into objects sharing the same name key. There is something similar here, but that doesn't answer my question because I have arrays as well.
var array = [{
VULN: [{random1:"asd11",random2:"asd12"}, {random3:"asd23",random4:"asd24"}]
}, {
VULN: [{random5:"asd35",random6:"asd36"}, {random7:"asd47",random8:"asd43"}]
}, {
VULN: [{random9:"asd55",random10:"asd51"}, {random11:"asd56",random12:"asd63"}]
}];
to
VULN=[{random1:"asd11",random2:"asd12"}, {random3:"asd23",random4:"asd24"},{name:"asd3",value:"asd3"}, {random5:"asd35",random6:"asd36"}, {random7:"asd47",random8:"asd43"}, {random9:"asd55",random10:"asd51"}, {random11:"asd56",random12:"asd63"}]