Functions and return


Replace this line with your code.


Please copy and paste in your code and explain what your having trouble with or we can't help you.


// Parameter is a number, and we do math with that parameter
var timesTwo = function(number) {
return number * 2;

// Call timesTwo here!
var newNumber = timesTwo(10);


What reference error are you getting?



I get function expected and codecademy asks if I set var newNumber = timesTwo(n).


Could I have a link to the exercise?



Your code is completely correct. Have you tried refreshing the page or resetting the exercise?


I thought it might be something like that.
Let me give it a try.


Indeed, after scratching my head for an hour, it was just a simple refresh of the page!


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