Test output not working

I noticed that functions do not return any values even if it says ‘return ___’.
I am forced to write “Console.log()” To see any output to visually test my code.
Is this how it’s supposed to be?

Your browser information:

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

Link to the challenge:

The function returns the value, you are just not doing anything with it.
To see what the function returns you can wrap the function call in this: console.log(JSON.stringify( ... ))

You can also visualize your code execution with a tool like this one: