Cube\Square


#1

Can someone explain to me what this code is wanting me to do? I am lost with this.

// Accepts a number x as input and returns its square
var square = function (x) {
return x * x;
};

// Accepts a number x as input and returns its cube
var cube = function ( ) {
return x * ;
};

cube(7);

Thanks appreciated.


#2

It's ok I have worked it out.

Cheers.


#3
Math.pow(x,3);

of course :smile:
But I guess the obvious answer for those that search it is probably x*x*x