Skip to content
Advertisement

Ties are still running win messages?

I’ve been messing around with a rock, paper scissors project that codecademy gets you to try, I’m pretty happy with it but I have one problem! When the result is a tie, it logs the tie message (perfect!) but also logs the win message linked with the result! How do I get it to ONLY log the tie message? Here’s the code:

JavaScript

Advertisement

Answer

Instead of logging the tie message, you should return it, leaving the logging to the caller:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement