Spread all the properties from Array of Objects into an object

Posted on June 28, 2022

This is the way:

const other = {c:3}

const arr = [
  {a:1, b:2}
]

// spread both an object props and an array of object props as well:
const res = Object.assign({}, other, ...arr)