Return Keyword


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-6LzGd/1/2?curriculum_id=506324b3a7dffd00020bf661

Introduction to Functions js, Return Keyword

The error message says I didn’t print out the value of newNumber. What am I doing wrong?



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

timesTwo(8);
var newNumber = function(number){
console.log(newNumber);
}
newNumber(5);


#2

Declare newNumber as a variable and set it equal to this.

newNumber isn’t meant to be a function.

Then, log newNumber to the console.

I hope this helps!


#3

That helped! Thanks!


#4

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