I have the following code snippet, which is executed when trying to insert an item in $scope.items{}
:
$scope.items.forEach(function(item, i){
if(item.codigo == $('#codigo').val()){
item.quantidade = parseInt(item.quantidade) + parseInt($('#quantidade').val());
return;
}
});
However, if the condition is met, return does not interrupt the rest of the code.
Note: outside the loop works normally.