To combine or merge JSON on Node.js, we use the spread operator.
For instance, we write
const o1 = { a: 1 };
const o2 = { b: 2 };
const obj = { ...o1, ...o2 };
to create the obj
object by spreading the properties of o1
and o2
into a new object.