1var ids = [1,2,3]; //Hundreds of elements here
2var names = ["john","doe","foo"]; //Hundreds of elements here
3var countries = ["AU","USA","USA"]; //Hundreds of elements here
4
5// Create the object array
6var items = ids.map((id, index) => {
7 return {
8 id: id,
9 name: names[index],
10 country: countries[index]
11 }
12});
13
14// Result
15var items = [
16 {id: 1, name: "john", country: "AU"},
17 {id: 2, name: "doe", country: "USA"},
18 ...
19];