Created
July 20, 2017 00:43
-
-
Save wescleymatos/a1b93e81c40988b8489270060b0c868e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const produtos = [ | |
{ | |
nome: 'Bicicleta', | |
preco: 1200.0 | |
}, | |
{ | |
nome: 'Capacete', | |
preco: 450.0 | |
} | |
] | |
let somaPreco = produtos.reduce((anterior, atual) => anterior + atual.preco, 0) | |
console.log(somaPreco) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Certinho.