Assigning event handler like so:
document.addEventListener("DOMContentLoaded", myFunction);
is it required for the handler function to be defined before the assignment code? In other words if the codes below
function myFunction() {...}
...
document.addEventListener("DOMContentLoaded", myFunction);
and
document.addEventListener("DOMContentLoaded", myFunction);
...
function myFunction() {...}
are identical?