here you are passing this function function(sortByYear) { console.log((a, b) => a - b); } and it has a sortByYear parameter, you are not passing the function sortByYear as callback
consider that you passed a function to sort, but you passed a wrong one, instead which is the function you are asked to pass? sortByYear, it already exists as sortByYear so you don’t need to create a new function, you just pass it
They keyword function defines a function. You only need to do that once.
Once it’s defined call it by just writing it’s name and brackets (and any arguments)
function hello() {
console.log("hello")
}
hello()
If you want to pass that function to another function don’t define it again. You need to pass a function reference to sort so you can omit the brackets. (You are passing the function name, not actually calling the function at that time)