Created
November 15, 2018 19:39
-
-
Save iagocavalcante/4aaa44ac8ab5bc20a9d5ffd22012e465 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 usuarios = [ | |
{ nome: 'Aluno 1', parcelasFaltantes: 3, valor: 89.9 }, | |
{ nome: 'Aluno 2', parcelasFaltantes: 5, valor: 19.9 }, | |
{ nome: 'Aluno 1', parcelasFaltantes: 7, valor: 49.9 }, | |
{ nome: 'Aluno 1', parcelasFaltantes: 6, valor: 69.9 }, | |
{ nome: 'Aluno 1', parcelasFaltantes: 2, valor: 99.9 } | |
] | |
let total = 0 | |
usuarios.forEach(usuario => { | |
total += usuario.parcelasFaltantes * usuario.valor | |
}) | |
console.log('valor total faltante =>', total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment