The sorting is either by key or by value and the returns are the key or the value resp.
Passing in functions when theyre anonymous is a little confusing due to the synax. Its hard to remember the prefix syntax is how arguments are passed in