Question: I'm working on a codebase with multiple blocks of code setting some behavior on document.ready() (jQuery). Is there a way to enforce that one specific block is called before any of the others? 

Background:
I need to detect JS errors in an automated testing environment, so I need the code that starts logging JS errors to execute before any other JS code executes.

Answer: 
As @jfriend00 mention that `ready callbacks are called in the order they were registered.`

So even if this code block called on the beginning, you can set another callback in it so it'll be executed on endmost.

```js
jQuery(document).ready(function(){
    jQuery(document).ready(function(){
        // This block will be executed after all ready calls.
    });
});

```
You can execute the logging start code in DOMReady and other initialization in load. Or you could make your own initialization manager which calls your logging start code first and then all other initialization callbacks (provided that those are registered with your manager and not jQuery, unless you want to hack jQuery and extract them from there, which I don't advise).