+ 1
How I can make a cube root of a number?
function squareRoot(){ setValues(); result = Math.sqrt(c); alert ("The square root of "+c+" is "+result); } function cubeRoot(){ setValues(); result = Math.cbrt(c); alert ("The cube root of "+c+" is "+result); }
5 odpowiedzi
+ 2
If you know the answer yourself, post it in the lessons to help others. Don't use the Q&A for that.
+ 2
Oh my bad! It looks fine. What error are you getting (or did you just think it wasn't legit)?
+ 1
@Maart sorry I thought that my code is not valid
+ 1
I thought Math.cnrt(c) is wrong
0
Well, you should define c first, but if you got a value assigned to it, then it's fine!