Continuar a execução somente após .each () concluir

Estou procurando uma maneira de chamar uma função somente depois de.each() termina sua execução. No exemplo abaixo, como garantir quepostPreparation() correimediatamente depoi $('.element').each() termina?

$('.element').each(function() {
  /** 
   * 'prepareLayer()' is a complex function that takes a while to complete and,
   *  as in this construct, needs to be invoked for each matched element. Basically,
   * 'prepareLayer()' adds a lot of new HTML elements to the page.
   */   
  prepareLayer();
});

/**
 * Ideally, this should immediately run _after_ the above function completes
 * i.e. after each '.element' finishes running prepareLayer().
 *
 * 'postPreparation()' needs to attach some event handlers for the new HTML elements
 * created in 'prepareLayer()'.
 */
postPreparation();

Tecnicamente, estou procurando uma maneira de chamar uma função de retorno de chamada para.each().

NOT: Acabei de confirmar, no exemplo acima, quepostPreparation() será executado somente depois de.each() termina. O problema foi meuprepareLayer() cria os novos elementos HTML usando AJAX, entãoeach() retorna prematuramente. Conforme sugerido por @Alnitak, uma solicitação assíncrona de AJAX não parava.each() retorne prematurament

questionAnswers(6)

yourAnswerToTheQuestion