5/15 More control flow on JS. Help me please, it doesn't work!


#1

I don't understand why it doesn't work ?
Help me please
Thanks a lot

var couleur = prompt("Quelle est votre couleur primaire favorite ?","Écrivez votre couleur favorite ici");

switch(couleur) {
case 'rouge':
console.log("Le rouge est une belle couleur !");
break;
case 'bleu':
console.log("C'est aussi ma couleur favorite !");
break;
case 'jaune':
console.log("C'est aussi ma couleur favorite 2 !");
break;
default:
console.log("Je ne pense pas que ce soit une couleur primaire !");
}


#2

Your code is Ok.
Are you getting an Oops-message or any-other message.

2 possibilities
-1 the popup-facility is disabled in your Browser
-2 under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum from Tony de araujo
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#3

It work !

Thanks a lot :smile: