Why is the system telling me that it's done?


#1

The code:

  1. Press Save & Submit Code
  2. Enter a choice of rock, paper or scissors.
  3. Hit Enter
    4, Notice that the console prints the computerChoice but not the return.
    5, Notice that the system says:"Congratulations, you've finished the course.

The exercise is not finished because the return value is not appearing.

HOW AM I SUPPOSED TO KNOW WHAT IS WRONG IF THE LESSON SAYS THAT EVERYTHING IS FINE?


#2

For starters, move this line down one more so it is not inside the function body.

compare(userChoice, computerChoice);

It will still not output anything, though. For output, use console.log() so it displays the return value.

console.log(compare(..., ...));

#3

Of course, thanks.

I keep forgetting that the console still prints a called function, even if it's not in the console.log(something that I still think is an issue)

Now it works as it's supposed to.

But the fact remains that the lesson claims that the code is correct and allows me to continue. This is unacceptable.

Student's can't be allowed to continue believing that their code is correct, when it's obviously not.

Again, thanks for the tip Roy


#4

Live with it. We all have for years, now. The course was written by a volunteer back in 2012 and the audience is getting it for free. Don't be a griper and work with what's put before you. That's what self-learners do. They question everything, especially themselves. Who cares what the lesson checker says? Are you satisfied with what your code has done? Did you follow the instructions? Is your code well formed? If it meets your expectations and all the above, then give yourself a pat on the back and move on.


#5

I guess, you're right


#6

Not that it matters, since it is not my goal to be right. Just go with the flow, follow instructions and keep everything simple for best results. Happy Coding!


#7

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