Return Keyword wont work


#1



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


I've done exactly what I need to do (I have looked at other posts) and it still says "Oops, try again. It looks like you didn't print out the value of newNumber".It says '16' in the box so I don't know what to do.


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

// Call timesTwo here!
var newNumber = timesTwo("8");
console.log(newNumber);


#2

If you put quotation marks around an 8, they call it a string. Your function timesTwo will work if you supply it with a number.


#3

thank you, this worked x


#4

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