Skip to content

Instantly share code, notes, and snippets.

@lucasdu4rte
Created July 20, 2017 03:33
Show Gist options
  • Save lucasdu4rte/ebdbaca14b8643c597c0a5fc84d66311 to your computer and use it in GitHub Desktop.
Save lucasdu4rte/ebdbaca14b8643c597c0a5fc84d66311 to your computer and use it in GitHub Desktop.
Exercicio 2a
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