Created
July 19, 2017 12:53
-
-
Save marcaosi/1fe8f8824f9383ec8bf73ca7216f229a to your computer and use it in GitHub Desktop.
This file contains 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 | |
} | |
] | |
console.log(produtos.reduce((valorAnterior, proximoValor) => valorAnterior + proximoValor.preco, 0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Certinho.