Sum of the series ( 1 * 2 ) + ( 2 * 3 ) + ( 3 * 4 ) + ... ... upto n terms | Function to return sum ; Driver code
function sum ( n ) { return n * ( n + 1 ) * ( n + 2 ) / 3 ; } var n = 2 ; document . write ( sum ( n ) ) ;