Inside a functions arguments or after it

Inside a functions arguments or after it

In this question I use the .each() function as an example
However my question regards Jquery in general.

In this example
$('.example span').repeat(1000) .each($).toggleClass('bold').wait(50); 
the code to run on each iteration comes after the each function.

However in this example

$( "li" ).each(function( index ) { console.log( index + ": " + $( this ).text() ); }); 
the code to run on each itteration comes in the arguments for the each function.

How do you know if the code to be executed for any Jquery function should come in the functions arguments or after it?