A project I am working on has some initialization code (not in any function) and some code in a jQuery $(document).ready() event. Which code executes first? Why? I'd also like to know why it might have been written that way? Thanks. For example:
'use strict';
let inputs = [];
function func(){};
function func2(){};
$(document).ready(function(){
const a = 1;
func2();
})