I have a question, I need to create a function that receives a% of people objects, that returns a new array only with person objects that are between 20 and 30 years old.
Can anyone help me if possible?
function pessoa(objec) {
var olders = objec.filter(function(person){
return person.age >= 20 && <= 30;
});
return olders;
}
Is that correct?