-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