[N/A] Error in Javascript conditionals quiz

Hello,
I just took the javascript conditionals quiz and one answer has me confused. Can someone please explain how none of the answers are correct? I realize my mistake in my selection, but I think the last selection is correct. Also, how am I supposed to select the correct answer if none of the answers are correct?
I do not have a screen shot, but I copied the text.

type or paste code here
How would you properly refactor this code block using the ternary operator?

if (walkSignal === 'Walk') {
    console.log('You may walk!'); 
} else {   
    console.log('Do not walk!');
}
Incorrect:
walkSignal === 'Walk' : console.log('You may walk!') : console.log('Do not walk!');
Incorrect:
walkSignal === 'Walk' ? ('You may walk!') : ('Do not walk!');
(Selected)Incorrect:
walkSignal ? console.log('You may walk!') : console.log('Do not walk!');
Incorrect:
walkSignal === 'Walk' ? console.log('You may walk!') : console.log('Do not walk!');

Any help would be appreciated!
Mel

Hi, welcome to the forums!

Doesn’t this one work? (I just tried it in the console and it worked fine):

walkSignal === 'Walk' ? console.log('You may walk!') : console.log('Do not walk!');

Yes, that I believe is the correct code. My question is why is it showing as incorrect on the quiz? As I said, I know why the code I selected was incorrect. But, how am I supposed to pick a correct answer wehn they were all marked as incorrect answers?

The answer to why is that it’s a mistakel

We can file it as a bug for CC to look at if all the answers were being marked as invalid.

@melprimrose777985690 I’ve moved this thread into the bug reporting for javascript. Thanks for pointing it out.

Thanks for posting this!
Could you post a link to the quiz?

Here’s the link:
https://www.codecademy.com/paths/web-development/tracks/getting-started-with-javascript/modules/learn-javascript-control-flow/quizzes/learn-javascript-control-flow-control-flow-quiz

Hey there @melprimrose777985690 :grinning: Thank you for the link!!

The answer both you and @toastedpitabread believed to be correct is registering that way

And the correct answer if highlighted in green if you select the wrong one:


It apears you are using some sort of dark style possibly an add on, it could be that this is overriding the border color change to green. I recommend disabling this and retrying the quiz.

2 Likes