📅  最后修改于: 2022-03-11 15:02:05.438000             🧑  作者: Mango
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);