Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (australopithecus):

How do I change the definition of the cube function so that it calls the square function as an intermediate step to compute the cube of a number. var x = prompt("Insert Number:"); var square = function (x) { return x * x; }; var cube = function (x) { return square(x) * square(x) * square(x); }; console.log(cube(x)); What am I doing wrong?

OpenStudy (australopithecus):

nvm I got it

OpenStudy (australopithecus):

I used the wrong output :S

OpenStudy (australopithecus):

var x = prompt("Insert Number:"); var square = function (x) { return x * x; }; var cube = function (x) { return square(x)*x; }; cube(x);

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!