How to load jQuery assets before blocks and regions I need a jQuery script to load immediately before a certain block shows on my Drupal 8 front page. I'm trying to use the following but I get 'TypeError $ is not a function' in code inspector. Here's my script:

$(document).ready(function() {
  $("#slideshow").zAccordion({
        ...code...
  });
});


The problem is the first line. In Drupal 8 what is the preferred way to write this script to accomplish what I want?
You have to wrap the javascript to avoid namespace conflicts.

(function ($) {
  $(document).ready(function() {
    $("#slideshow").zAccordion({
        ...code...
    });
  });
})(jQuery);