Program to find the sum of a Series 1 + 1 / 2 ^ 2 + 1 / 3 ^ 3 + â €¦ . . + 1 / n ^ n | Function to calculate the following series ; Driver Code
function Series ( n ) { let sums = 0.0 ; for ( let i = 1 ; i < n + 1 ; i ++ ) { ser = 1 / Math . pow ( i , i ) ; sums += ser ; } return sums ; } let n = 3 ; let res = Math . round ( Series ( n ) * 100000 ) / 100000 ; document . write ( res ) ;