Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/return-a-value-from-a-function-with-return

Tell us what’s happening:
why is the code not showing the results, i’m I supposed to use any console? I really don’t understand why the function is not running.

Your code so far


function timesFive(num){
return num * 5
}
timesFive(3);
timesFive(5);
timesFive(2);
timesFive(0);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36.

Challenge: Return a Value from a Function with Return

Link to the challenge:

I ran the code and it passes the test
Might be just some catch causing an error. Try emptying it
Switch over to lightmode
or switch to another browser

the function is running, you just don’t have anything to print the result to the console

for that you can wrap the function calls in console.log() statements

for example: console.log(timesFive(5))

okay thank you, i was just confused of how to print out the function.
but again why is it that sometimes is use console.log but it shows thee value and an undefined answer below it??

I think this site: http://pythontutor.com/visualize.html#mode=edit
might help to visualize that for you

Thank you @KittyKora. I figured out where the problem was.

console.log returns undefined, so you could be seeing the stuff inside the console.log printed to the console and then the return value of the console.log, some editors show the returned value of last expression in the code