Return keyword


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/1/2

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



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

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




#2

There is the object of interest. All that other code is fodder.

var newNumber = timesTwo(21);
console.log(newNumber);    // -> 42

#3

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