1var employees = {
2 accounting: []
3};
4
5for(var i in someData) {
6
7 var item = someData[i];
8
9 employees.accounting.push({
10 "firstName" : item.firstName,
11 "lastName" : item.lastName,
12 "age" : item.age
13 });
14}
15
1var array = ['a', 1, 'b', 2, 'c', 3],
2 object = {},
3 i
4
5for (var i = 0; i < array.length; i += 2) {
6 object[array[i]] = array[i + 1];
7}
8
9console.log(object);