Why am I getting an error message?


Return Keyword

It seems to be printing the correct value, but i get the error message

"Oops, try again.
It looks like you didn't print out the value of newNumber"

Why is that?

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

// Call timesTwo here!
var newNumber = timesTwo(prompt("type a number"))



You have to put a "number" as a parameter for timesTwo, not a prompt. The syntax is good, but I guess that for this exercice it's not the goal. I'm training too, so fighting !



var newNumber = timesTwo(5)

I understand what you're trying to do but I dont think thats the object of the lesson so it wont pass you


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