乐趣区

关于javascript:两个一维数组转换为二维数组

    let arr1=['a','b','c'];
    let arr2=[1,2,3];
    let arr3 = []
    for(var i = 0;i<arr1.length;i++){arr3.push([arr1[i],arr2[i]])
    }
    console.log(arr3);//[['a', 1],['b', 2],['c', 3]]
退出移动版