HELP?: Console.log MELTDOWN. Newbie WEEPING @ debugging fail


#1


Hi Team! This is the error I am getting:

[This is the exercise that is getting me stuck: introduction to functions in JS #7 Return Key words.]

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

MY ERROR MESSAGE LOOKS LIKE THIS:

"ops, try again. It looks like you didn't print out the value of newNumber"

My code looks like this:

var timesTwo = function(number) {
    return number * 2;
};

 timesTwo(15)
var newNumber = timesTwo(5);

console.log(newNumber)

Any ideas, why it won't print? Forgive me if it is something obvious! New to coding and excited to figure out self- debugging!

Thanks loads?


#2

That line can be removed since it doesn't serve any purpose. It may be that the SCT doesn't have a message to correspond with unexpected code.


#3

Thanks so much MTF!!!!!

! The exercise instruction ask me to print it. But it isn't necessary to use console.log, I guess!!!! Thanks again. Worked now.


#4

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