Sum of squares of first n natural numbers | Return the sum of square of first n natural numbers ; Driven Program
function squaresum ( n ) { return ( n * ( n + 1 ) / 2 ) * ( 2 * n + 1 ) / 3 ; } let n = 4 ; document . write ( squaresum ( n ) ) ;