-2
我只想检查else条件。有没有一种方法可以简化下面的代码?这个逻辑语句的反义词是什么
if (_endCurrentGoal && _startCurrentGoal && _startCurrentGoal === _startEffectiveDate && _endCurrentGoal === _endEffectiveDate) { //no statement);
}
else {
console.log("check for this code only");
}
以下代码正确吗?有没有简化它的方法?
if(!(_endCurrentGoal && _startCurrentGoal && _startCurrentGoal === _startEffectiveDate && _endCurrentGoal === _endEffectiveDate) {
console.log("check for this code only");
}
啊,这是正确的,但我更喜欢第一种方法 –
但我并不需要检查的第一个if语句。只需要执行else语句 – noob
那么伤心,人们只是低估了我的问题。这并不是说我没有试图解决它 – noob