Empty tags

Firstly, is this:https://www.codecademy.com/paths/web-development/tracks/getting-started-with-javascript/modules/learn-javascript-functions/projects/rock-paper-scissors-javascript bugged for anyone else? I keep getting the wrong colors for parameters in the first line.

Secondly, in this exercise one of the lines is:
const getComputerChoice = () => {
}

How comes the parameter is empty and is greater later on?

Hello @board1774168228.

I shouldn’t worry about this-if the code is working, then the colours are arbitrary. (If you want to independently check for errors in your code outside of CC, this is a free online compiler:https://paiza.io/projects/imd_FXjlMwSvnLQ4b7kMfw?language=mysql).

You can have empty parameters if you want the function to accept no input. In this case, you don’t need it to accept any input, as you are just using some mathematical operators to return the computer’s choice.

Do you mean something like this:

if (getComputerChoice() > condition1) {

}

This checks to see if the value returned from the function getComputerChoice is greater than condition1.
I hope this helps!

1 Like

Makes sense, thanks so much!!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.