Thread:Project:Support desk/mw.config.get

I have a bit of trouble understanding Manual:Interface/JavaScript.

I'm relatively new to JavaScript. I've been revamping an edit counter script for the past two-three months that uses the API and posts a table to a page. These few months are my only JavaScript experience and I think I'm doing great learning by myself (with Internet help, of course). The old script was very specific to certain wiki elements and required tinkering to get it to work on another wiki using different install options, such as no $wgScriptPath set on the wiki I was trying to use it on and the first wiki had /w/ hardcoded into the ajax calls. I have gotten to the point where the script is smart enough to work as-is on practically any MediaWiki install, but of course, I don't have the means to test it like that, so I'm still learning as I go.

Anyways, my question, or request for clarification, is about using mw.config.get vice just using the wg variable directly. If I understand the page I linked correctly, I do not have to use mw.config.get if $wgLegacyJavaScript is, correct? I noticed other scripts I have seen plop wgServer and wgScriptPath straight into an ajax call without using mw.config.get and my current revision of my script uses a few other wg variables and it works without having to use mw.config.get anywhere, but if $wgLegacyJavaScript is set to  on some wiki where someone uses my script, will my script not work?

If you want to browse my script, it is at wikipedia:User:Kanegasi/editcounter.js. If you're wondering why the revision history of that page is short, the original location I was working at was minecraftwiki.net and the full page history of my successes and failures can be seen here.