我正在编写一些有特定要求的代码。
if(condition){
if(condition){
}else{
//if comes here then goto previous else
}
}else{
// come here if it goes to upper else part.
}
最佳答案
您应该能够在单个 if 语句中执行此操作。只需使用 bool AND 运算符连接您的条件即可
if (condition && condition)
{
}
else
{
}
关于javascript - 如何摆脱 if 条件并进入除 if 条件之外的 else 条件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50700691/