Functions and return


#1


Replace this line with your code.


#2

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


#3

// 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);
console.log(newNumber);


#4

What reference error are you getting?


#5

Sorry,

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


#6

Could I have a link to the exercise?


#7

https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/1/2?curriculum_id=506324b3a7dffd00020bf661#


#8

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


#9

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


#10

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


#11

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