This "if (answer += i * x)" is not correct because the result of the expression is not a boolean.
Instead of this statement you can put "answer += Math.pow(x, i);"
Type: Posts; User: RmSc
This "if (answer += i * x)" is not correct because the result of the expression is not a boolean.
Instead of this statement you can put "answer += Math.pow(x, i);"