Cube a number Javascript
Write a function called "cube".
Given a number, "cube" returns the cube of that number.
Can someone explain this to me please
vedprad1
This is simple mathematics. If you have a number, the cube of the number is that number multiplied by itself 3 times. In other words, the cube of n
is n * n * n
, or n^3
.
If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!
If you want the answer, it is here:
If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!
return Math.pow(num, 3);
but your way works as well