Posts by Gean Das Chagas • 5 points
1 post
-
-2
votes6
answers47809
viewsA: How to search for a particular object within an array?
var id = 1; var dados = [{id: 1, nome: 'Wallace'},{id: 2, nome: 'Wall'}]; var i = dados.indexOf(dados.filter((item) => item.id == id)[0],0); console.log(i); …