n | Function to find the nth term of series ; Loop to add 4 th powers ; Driver Code
function sumOfSeries ( n ) { let ans = 0 ; for ( let i = 1 ; i <= n ; i ++ ) ans += i * i * i * i ; return ans ; } let n = 4 ; document . write ( sumOfSeries ( n ) ) ;