Rock Paper Scissors - return vs. console.log()

Hello Guys!

I am learning JS and got a question about [this]( Lesson.
Inside the function, I use return for userInput. Unfortunately, it never prints anything.
With console.log() everything works out fine.

Is there a bug? What am I missing to understand?

a return statement has nothing to do with writing text to console if that’s what you mean

Imagine if you tried to add two numbers and the result got written to screen. Imagine trying to do anything at all, and all of it is dumping stuff to the console.

If you want something printed, print it.

1 Like

Oh thank you ionatan :slight_smile: This helps a lot!

1 Like