I don't understand nesting!


Hello there! For some reason, I don't understand what I'm doing with the && and || commands here? I'm pretty sure that they need to be numerical, cuz that's what the example stated. However, the code doesn't really fit in with the scenario I'm coding. Please help!


SyntaxError: Unexpected token )

var user = prompt("Do you like Beyonce?").toLowerCase();

switch(user) {
    case 'Yes':
        console.log("Hell Yeah you do!");
    case 'No':
        console.log("Beyhive Heaux!");
    case 'IDK':
        console.log("Eh. Listen to self-titled.");
        case 0:
        if (listen == 1 || 2>) {
            console.log("Thanks for giving her a try!")
        else(0 && 1) {
            console.log("Well, pick and albulm!")
    console.log("Excuse me, come again?");



Here's a FAQ for you to read: Comparisons : Explanation

else doesn't take a condition .. syntax is just like this:


also don't forget semi colons at the end of console.log
missing a break;


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