I have a couple of arrays that look like the following:
var foo = ['id', 'first', 'last'];
var student1 = ['1', 'sam', 'smith'];
var student2 = ['2', 'jon', 'murphy'];
Is there an efficient tool, perhaps using a library like underscore.js or vanilla javascript that will allow you to turn those three arrays into an object that looks like the following:
var finalObj = [
{'id' => 1, 'first' => 'sam', 'last' => 'smith'},
{'id' => 2, 'first' => 'jon', 'last' => 'murphy'}
];