给定以下数组:
var ids = [1,2,3]; //Hundreds of elements here
var names = ["john","doe","foo"]; //Hundreds of elements here
var countries = ["AU","USA,"USA"]; //Hundreds of elements here
Run Code Online (Sandbox Code Playgroud)
生成具有与此类似结构的对象数组的最佳性能方法是什么:
var items = [
{id:1,name:"john",country:"AU"},
{id:2,name:"doe",country:"USA"},
...
];
Run Code Online (Sandbox Code Playgroud)