Board Thread:Support Requests - Getting Technical/@comment-4368470-20190905085751/@comment-24692230-20190905090224

is fired when the page loads (and when you preview your edit and other things happen too if I remember correctly), so your function is running when the page and etc load, logging your string to the console. The use of  is for scripts, so you can have events where things happen (eg, your script is done loading) and other code or other user's code can listen for those events and run their code when the event happens. (see w:c:dev:MediaWiki:FastDelete/code.js for an example of )