简体   繁体   English

如果有 4 件事是真的,那么做 ____。 很难使用 If 语句并检查 4 个值是否为真以执行代码

[英]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.得到一个 r 值错误,我假设这是语法。 Could someone help me what would be the correct format/method to do this?有人可以帮我做这件事的正确格式/方法是什么吗?

you are missing a double quote What I like to do is install prettier, when you cannot format your code, it's mean there are some syntaxs that's are not correct你缺少双引号我喜欢做的是安装更漂亮,当你无法格式化你的代码时,这意味着有些语法不正确

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM