Return Keyword Help


#1

So here's my code.


var timesTwo = function(number) {
return number * 2;
};

// Call timesTwo here!
var newNumber = function(number) {
console.log(newNumber);
}

timesTwo(8)

The response:

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

What did I do wrong?


#2

change:

console.log(newNumber);

to

console.log(number);


var newNumber = function(number) {
                           v
                           |
                  /--------/
                  |
                  v
    console.log(number);
}

--EDIT--
Afterwords add:

newNumber(3); //The actual number doesn't matter, that's just the parameter!

#3

Afaik you just need to call the timesTwo function, store the result in new number:

var newNumber = timesTwo(42);

and then console.log it.