I need help in logical operators if /else


#1

var user=prompt("do u like cricket").toUpperCase();

switch(user) {
case 'cricket':
if( cricket&&soccer==true){
console.log("love it");}
ele {
console.log("no");
break;
case 'soccer':
if(soccer||hockey)
console.log("kind of.");
break;
case 'hockey':
if(cricket&&hockey || hockey){

    console.log("not much!");}
    else {
        console.log("hey");
    break;
default:
    console.log("I don't know !");

}


#2

@tagsurfer58193,
Your

cricket&&soccer==true

should be

 cricket==true && soccer==true

Reference

google search
== the Book ==
javascript operators site:developer.mozilla.org
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Operators/Operator_Precedence