Share your repls and programming experiences

← Back to all posts
arr.filter
hiensambi9999 (0)

var members = [
{ name: 'Lan', gender: 'female' },
{ name: 'Linh', gender: 'female' },
{ name: 'Trung', gender: 'male' },
{ name: 'Peter', gender: 'gay' }
];
var result = members.filter(function( obj ) {
return obj.gender == "male";
});
console.log(result);