Umm...cubing? can anyone help when cubing using squares?


#1


https://www.codecademy.com/courses/functions-in-javascript-2-0/3/3#


Error messages include:
null
and Oops, try again. false


var square = function (x) {
  return x * x;
};

var cube = function (x) {
  return square * x;
};
cube(3)


#2

not sure about js but in ruby you can do x**2 for square x ** 3 for cube i believe its the same in js. if not take and look at your cube function you call on square but have no input argument. square(×) * x that should fix it


#3

oh my god thank youuu! I replaced

return square * x;
with
return square (x) * x

like you said and it worked! Thanks so much! :smiley:


#4

your welcome glad i could help.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.