我在一个 JavaScript 繁重的应用程序中工作,我有以下代码:
function displayingNotes() {
if (!($scope.overseasTravelTask.RegisteredKeeperName.toLowerCase()
.indexOf("zenith") > -1 ||
$scope.overseasTravelTask.RegisteredKeeperAddressLine1.toLowerCase()
.indexOf("zenith")
)
)
{
$scope.calloutClass = 'callout-danger';
$scope.calloutMessage = 'We (Zenith) cannot provide this vehicle with the necessary documents.';
$scope.disableNextBtn = true;
}
else
{
$scope.calloutMessage = 'Please ask driver about this.';
}
}
对于if 语句,我在 Chrome 控制台中放置了一个断点并检查我的逻辑,逻辑看起来是正确的,但是当我单击 F10 按钮时,我希望进入 if 语句,而不是跳过它!