Why am I getting an error message?


#1


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


#2

Hello,

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 !

Bye


#3

var newNumber = timesTwo(5)
console.log(newNumber);

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


#4

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