BUG: Switch statement


#1

This is the exercise

https://www.codecademy.com/en/courses/javascript-beginner-en-qDwp0/1/4?curriculum_id=506324b3a7dffd00020bf661#

I found this issue on a forum post where the user could not get past this exercise. I am using Windows 8.1 and Chrome, although I am not sure what the original user from the forum was using, also this doesn't seem to be an OS/browser issue.

With this code, the exercise works:

var response = prompt( "testing..." );
switch( response ){
    case 'a':
        console.log( "first " );
        break;
    case 'b':
        console.log( "second " );
        break;
    case 'c':
        console.log( "third " );
        break;
    default:
        console.log( "answer: " + response );
        break;
}

However, by simply changing the strings inside of the console.log statements to include the word "case", the exercise gives you this error: Oops, try again. Make sure you have a break statement for each case.

Example of non-working code:

var response = prompt( "testing..." );
switch( response ){
    case 'a':
        console.log( "first case" );
        break;
    case 'b':
        console.log( "second case" );
        break;
    case 'c':
        console.log( "third case" );
        break;
    default:
        console.log( "answer: " + response );
        break;
}

With a little more testing, it seems like if only one of the switch statement's cases contains a console.log("case"), then the exercise will work, but if two or more cases contain a console.log() with the word case inside, then the exercise will fail.


#2

The endless balance between super strict checking (only an exact match) is passing, or some freedom in the lesson, (which we have), it is super difficult to make everything air tight.