Exercise 7 - Introduction to Functions in JS


#1

I don't know what is going wrong in my code in exercise 7! Can someone help me, please!!


#2

Hi @rubyblaster10912 ,

when asking for help with specific code or problems, if you could please post the code in questions with a description of the problem you are receiving someone will be sure to try and help as soon as they can.

With that in mind and using the subject of your topic in question, please see the following code example for Lesson 2 Ex 7, hopefully this will give you some idea and a helping hand to keep you going.

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

// Call timesTwo here!
var newNumber = timesTwo(5);
console.log(newNumber);

Happy Coding =)

Cheers,
Michael


#3

Hello mike_in_training!

Thanks for the advices. My code was right, I don't know whats was going on. I've returned to the exercise after closing the window from codecademy and it works normaly now! But thank you, anyway!


#4

Awesome work @rubyblaster10912, you resolved your issue, got it up and running and progressed forwards all in a few minutes, you're a natural =) Great job!