Find the Sum of the series 1 + 2 + 9 + 64 + 625 + 7776 . . . till N terms | Function to find the sum of series ; Generate the ith term and add it to the sum ; Print the sum ; Driver Code
function printSeriesSum ( N ) { let sum = 0 ; for ( let i = 1 ; i <= N ; i ++ ) { sum += Math . pow ( i , i - 1 ) ; } document . write ( sum ) ; } let N = 5 ; printSeriesSum ( N ) ;