我有两个长度相同的数组:
$scope.access_name = ['group1','group2','group3','group4']
access_value=[1,2,1,3]
我如何结合得到这样的结果:
object_access = {'group1:1','group2:2','group3:1','group4:3'}
非常感谢
答案 0 :(得分:1)
var object_access={};
for(int i=0;i<access_value.length;i++)
{
object_access[$scope.access_name[i]]=access_value[i];
}