A typedef
essentially defines the signature of a function (callback).
Look at the example below. The crazy
function complies with the “type definition” of Comparison
, which is exactly what we can feed to a List
’s sort
function.
Open the console and hit “Run” several times!