sortSpeciesByTeeth(); undefined error

I feel like I keep popping on here with increasingly boring questions, but I am stumped. Why am I getting an undefined log on the console for this?

const sortSpeciesByTeeth = arr => {
  arr.sort((a, b) =>  a.numTeeth - b.numTeeth
  )
};

The only thing I can figure is that it’s my a and b variables, but I’m not sure how to define them given that they’re referring to the various objects in the array.

Thank you for any guidance you can give.

Hello! Could you post the full code, and the exact error, please?

Sure, of course:

const speciesArray = [ {speciesName:'shark', numTeeth:50}, {speciesName:'dog', numTeeth:42}, {speciesName:'alligator', numTeeth:80}, {speciesName:'human', numTeeth:32}];

const sortSpeciesByTeeth = arr => {
  arr.sort((a, b) =>  a.numTeeth - b.numTeeth
  )
};

This was for the Intermediate JavaScript challenges. The goal is to sort the species listed by the numTeeth value. It keeps returning undefined and I can’t figure out why. I

In the exercise, I changed the operator from the - to the > and it functions to sort, but I don’t understand why this code as-is returns undefined.