I am facing a situation where I have an if statement that needs to halt execution but only after certain processes have been completed. This if statement is enclosed within a forEach loop in an Angular context.
angular.forEach($scope.obj, function ( value, key) {
if( id == key) {
delete $scope.obj[id];
result.clicked = false;
//break here, don't run the else
} else {
$scope.obj[id] = result;
result.clicked = true;
}
})