Created
July 20, 2017 03:33
-
-
Save lucasdu4rte/ebdbaca14b8643c597c0a5fc84d66311 to your computer and use it in GitHub Desktop.
Exercicio 2a
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 = [ | |
{ | |
id: 1, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 2, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 3, | |
preco: 10.0, | |
qtd: 2 | |
}, | |
{ | |
id: 4, | |
preco: 10.0, | |
qtd: 0 | |
} | |
] | |
const positivos = produtos.filter(function(produto) { | |
return produto.qtd > 0 | |
}) | |
console.log(positivos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment