📜  js 创建 json 数组 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:25.444000             🧑  作者: Mango

代码示例2
var array = ['a', 1, 'b', 2, 'c', 3],
    object = {},
    i

for (var i = 0; i < array.length; i += 2) {
    object[array[i]] = array[i + 1];
}

console.log(object);