Search code examples
javascriptif-statementlogicboolean-logicmultiple-conditions

If 4 things are true then do ____ . Having a hard time with the If statement and it checking if 4 values are true to execute the code


   if (test1 === 'hi' && test2 === 'bye' && test3 = 'joe' && test4 === 'sam') {  

console.log("all 4 statements are true!!);
      }; 

getting an r value error which im assuming is syntax. Could someone help me what would be the correct format/method to do this?


Solution

  • if (test1 === 'hi' && test2 === 'bye' && test3 === 'joe' && test4 === 'sam') {  
      console.log("all 4 statements are true!!");
    }