Is there any other way to do a return statement other than discussed in the above thread?

If you remove where you invoked the function you’ll notice that it still prints out timesfive(5) === 5

What it’s printing out if the result of the test. If you want to log the result of timesfive(3) you need to use console.log(timesfive(3)) but I wouldn’t recommend the FCC page for using console.log(). Use jsbin or some other online IDE.

What am I suppose to learn from this example again? I was wondering how to note this concept in my notes, for ease of reference.

The title of the challenge would probably be a good reminder for your notes.

I thought, based on your feedback, that it should be printing out 5 times 3. Why is it printing out 5 times 5? (I don’t know why its italicizing…)

:thinking: Legitimately can’t tell if you’re trolling us.

I’m not trolling, I really want to understand this concept. I guess it’s hard to tell tone.

So where are you getting 53 and 55 from? I’m really not even sure what you aren’t getting at this point? It started out questioning what num and bum where referencing which we said was the value that you pass into the function.

That was a mistake because of the format of writing in the forum and it is fixed now.

Remove

timesFive(3);

from your code. You’ll see that it still prints out

timesfive(5) === 25 

because that is the test that FCC uses to make sure you have the correct answer.

If you are typying out

timesFive(3);

because you want the console to print out 15, use a different console. Either the one in the Browser or one on jsbin.com because the one on FCC isn’t good to interact with.

Lastly, if you want to print the results of

timesFive(3);

to the console you need to instead type this in your program:

console.log(timesFive(3));

Five times five is being printed out because your challenged passed the test. No other reason. Your code isn’t producing that result, the test is.

1 Like

I am still trying it out in the editor but your explanation seems right.

1 Like

function timesFive(num){
return num *5;
}

var result = timesFive(5);
var result = timesFive(2);
var result = timesFive(0);

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Thank you for understanding.