Passing function as parameter to not working

I cant seem to pass a function as a parameter
What’s wrong with this code?