Bu satırlar kodu vardır:lodash.js _.each döngüsü nasıl durdurulur?
_.each($scope.inspectionReviews, function (value, key) {
alert("status=" + value.IsNormal + " " + "name=" + value.InspectionItemName);
if (!value.IsNormal) {
$scope.status = false;
return;
}
$scope.status = true;
})
Ben döngü durdurmak istiyorum Bir noktada ama dönüş çalışmıyor gibi görünüyor.
Döngüyü nasıl durdurabilirim?
'false 'i iade ettiniz mi? – adeneo
['break'] 'ı (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break) deneyin. –
Olası yinelenen [Nasıl döngü için durdurulur?] (http://stackoverflow.com/questions/9830650/how-to-stop-a-for-loop) – Jesse