This jQuery course recommends defining your own jQuery utility functions as a good way to organise your code.
But it doesn't really explain why. So, why is writing code like:
$.highlightResults = function(seats) {
//
}
$.highlightResults('/.seating-chart a');
preferable to simply:
function highlightResults(seats) {
//
}
highlightResults('/.seating-chart a');
Is the course wrong, or is there a good reason to write it this way?