Struck in return keyword part, Anyone help me


#1

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

// Call timesTwo here!
var newNumber = function timesTwo(){
console.log(newNumber);
};
https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/2?curriculum_id=506324b3a7dffd00020bf661


#2

Hi, #vivek20

// here you declare the function:
var timesTwo = function(number) {
   return number * 2
}

// here is how you assign a function's result to a new variable:
var newNumber = timesTwo(2);

//here is how you print it out to the console:
console.log(newNumber);


//Cheers!

#3

thx a lot bro, it's working :slight_smile:


#4

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