1) Use let
instead of var
. This does not affect functionality. It is a standard.
2) Why are you in a function pass a string argument? I removed in my example
3) you are all right, but you do not return anything from a function and don't piss inside her result. return - displays the output of the function returns values that can already be displayed in the console.