3
And I have an array of objects in javascript:
var array =
[
{
conta_id : "7",
marcar : 1,
pag_data_emissao : "04/08/2015",
pag_debito_credito : "D",
pag_historico : "CHEQUE 331107 VENDA S",
pag_id : "47782",
pag_utilizado :"VENDA S",
pag_valor : "7.000,00"
},
{
conta_id : "7",
marcar : 0,
pag_data_emissao : "07/08/2015",
pag_debito_credito : "D",
pag_historico : "DEPOSITO 3117 VENDA X",
pag_id : "47783",
pag_utilizado :"VENDA X",
pag_valor : "640,63"
}
];
I would like to filter the array with the method. filter() where I returned all objects that have the attribute mark == 1, but only found literature and English so I could not understand how it would look.
var a = array.filter(function(obj){ obj.marcar==1; });
With the code above it does not give error but also brings me nothing.
missing the Return in function.
– Tobias Mesquita