Javascript – How to print a name by a given ID
var people = [ {name: 'John', id: [34, 44, 77]}, {name: 'Jose', id: [43, 54, 65]}, {name: 'Hanna', id: [56, 34, 98]} ]; var peopleFinder = people.filter(function(b){ return b.id === 56; }).map(function(n2){ return n2.name; }) console.log(peopleFinder); How to print an…