5. Logical operators (Wall Hit)


#1

Hi there!!! I can not figure out what I code wrongly. Maybe someone may have some 'fresh' look into my Adventure Code??

var user = prompt("Hi!!! What are you doing in here? Looking for some INSPIRATION? Do you wanna have FUN? Or maybe you just want to RELAX?").toUpperCase();

switch(user) {
    case 'INSPIRATION':
        
        var outdoor = prompt("We will share some beautiful stuff, that will inspire you to do great things! Do you like outdoor activities?").toUpperCase();
        var indoor = prompt("Maybe you prefer to stay at home?").toUpperCase();
        
        if( outdoor === 'YES' || indoor === 'YES') {
            console.log('It is great that you like varieties of things!');
        }
        else {
            console.log('We will help you to figure things out!');
        }
       
        break;
    
    
    
    
    case 'FUN':
        var party = prompt("Great! Let's have some fun then! Are you real party animal?").toUpperCase();
        var unsocial = prompt("Or you prefer to play chess with a brainiac?").toUpperCase();
        
        if( party === 'NO' && unsocial = 'NO') {
            console.log('Really? You are hard to satisfy to!');
        }
        else {
            console.log('For sure we will find sth you realy like!');
        }
        break;
    
    
    
    
    case 'RELAX':
        var meditation = prompt("Uhmm...Uhmm... ready to start meditating?").toUpperCase();
        var active = prompt("Maybe you prefer to do more active stuff!").toUpperCase();
        
        if( meditation === 'YES' || active === 'YES') {
            console.log("Ok! Let's start then!!!");
        }
        else {
            console.log('We will help you to figure things out!');
        }
        break;
    
    default:
        console.log("Hmm...you are indecisive creature");
    
}

I get "Oops, try again. Your code doesn't look quite right. Check the error message for more info: ReferenceError: Invalid left-hand side in assignment" pop uped...


#2

Hi Marta,

A linter is a program that checks for errors in your code. In this course there is no linter to help you out.

A trick for you: copy/paste your code into a different site and it will point out where the problem is. For example: here


#3

Please have a look on you Case 'FUN'...here it's written "unsocial = 'NO' " instead of unsocial==='NO'..try again after correction if it works .Thanks for sharing :slight_smile: