如何在JavaScript中使用map()和reduce()将数组转换为对象数组