Cube a number Javascript
MDemery (0)

Write a function called "cube".

Given a number, "cube" returns the cube of that number.

Can someone explain this to me please

You are viewing a single comment. View All
vedprad1 (727)

If you want the answer, it is here:

function cube(n) {
  return n * n * n;
}

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

MDemery (0)

@vedprad1 thanks gthat works but I used

return Math.pow(num, 3);

but your way works as well