i had create a code of the SpeciesByTeeth() project like this :
const speciesArray = [ {speciesName:'shark', numTeeth:50}, {speciesName:'dog', numTeeth:42}, {speciesName:'alligator', numTeeth:80}, {speciesName:'human', numTeeth:32}];
// Write your code here:
const sortSpeciesByTeeth = (array) => {
return array.sort(parseInt(species.numTeeth, 10))
}
for sorts the array in ascending and sorts the array in ascending order based on the average number of teeth that species possesses ( numTeeth
) but not work correctly can soeone help me