7. Return keyword


#1

// 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(8);

Stuck :confused:


#2

To call a function, we simply specify the name and any parameters:

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

#3

Thank you, I managed to figure it out.


#4

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