I have an object of arrays say
obj_of_arr = {a : [1,2], b:["foo","bar"]}
and I want to turn it into the equivalent array of objects
arr_of_obj = [{a:1,b:"foo"},{a:2,b:"bar"}]
What is the most elegant way to achieve this? I can "brute force" this but I want to know if there is an elegant way. If it involves jQuery it's fine.