May 17, 2025

const names = ['John', 'Mike', 'Nash']
const age = [32, 33, 56]

const people = names.reduce((accumulator, currentValue, currentIndex) => {
    accumulator['name'] = {age: age[currentIndex]}
    return accumulator
  },
  {}
})