Reduces over points, treating x and y separately.
// Sum x and y valuesconst total = Points.reduce(points, (p, acc) => { return {x: p.x + acc.x, y: p.y + acc.y}}); Copy
// Sum x and y valuesconst total = Points.reduce(points, (p, acc) => { return {x: p.x + acc.x, y: p.y + acc.y}});
Points to reduce
Reducer
Optional
Initial value, uses { x:0, y:0 } by default
{ x:0, y:0 }
Reduces over points, treating x and y separately.