ok so here is the question i am trying to pull the name of an animal if the population is less than 5 using the .filter method. set lowPop as the new array but it always returning as undefined. im not sure why that is could anyone assist?
I have attached a picture to show what the question is asking along with my code. i am getting that my var is undefined and my code is returning a boolian true or false response. the expected response is in the picture. any assistance is greatly appreciated.
code and question with expected/error pic
function lowPopulationAnimals(){
const lowPop = [];
zooAnimals.filter((element => {
lowPop.push(element.population <= 5 );
}));
console.log(lowPopulationAnimals);