Lesson 7 javascript


#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(pop){
console.log(newNumber);
}
newNumber("6")

please tell me error in it..how to make this correct ?


#2

Step 1. You need to create function that do math with parameter. And it's done correctly.
Step 2. Now you need to call your function created in step 1 like this:

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

#3

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