Task

Write a program to find the sum of squares of a numeric vector.

The program should work on a zero-length vector (with an answer of   0).



Related task

   Mean


let sumOfSquares = (acc, item) => { acc + item * item }
 
Js.log(Js.Array2.reduce([10, 2, 4], sumOfSquares, 0))