I have an array of objects, let's say [{x:2, y:3}, {x:5, y:4}] and i call reduce((c, n) => c.y + n.y); on it. It obviouslly returns 7.
However, if the array contains a single object, let's say [{x:2, y:4}] the same reduce call will return the object itself {x:2, y:4}.
Is this normal behaviour? Am I obliged to check if the result is an object and not an number afterwards?