Does the constructor of javascript need not be written in the entry function?

Does the constructor of

javascript need not be written in the entry function

used to be written in window.onload = function () {}, but today I suddenly found that I forgot to write the entry function at the beginning (the constructor is written in front of the html that needs to be operated), and the constructor can also be executed.
is this the case? no relevant

was found.
Mar.20,2021

there is no inevitable relationship between the two, unless you manipulate dom, in the constructor, then you may not get the dom element


what is the constructor of javascript?
should be your custom object (library package) and other initialization functions.
this is not necessarily related, as long as you initialize it before using it and deal with bindings that do not involve DOM.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4960e-44d19.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4960e-44d19.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?