[1, 2, 3].reduce((acc, elm) => (acc + elm)) // 6
const arr = [{ apple: 1, cat: 2 }, { dog: 3 }, { bird: 4}]; const res = arr.reduce((acc, elm) => ({ ...acc, ...elm })); /*{ "apple": 1, "cat": 2, "dog": 3, "bird": 4, }*/