Commit d7f62d63f29bffad7b27661cdaee49e3e494bc98
1 parent
6ff8cc8cab
Exists in
master
Cambio de for a foreach.
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
src/app/components/popover-promos/popover-promos.component.ts
... | ... | @@ -31,9 +31,10 @@ export class PopoverPromosComponent implements OnInit { |
31 | 31 | calcularPrecioDePromo(productos: Producto[]) { |
32 | 32 | |
33 | 33 | var precio = 0; |
34 | - for (let i = 0; i < productos.length; i++) { | |
35 | - precio += productos[i].PreVen; | |
36 | - } | |
34 | + productos.forEach(producto => { | |
35 | + precio += producto.PreVen; | |
36 | + }) | |
37 | + | |
37 | 38 | return precio; |
38 | 39 | } |
39 | 40 |