I have the need to do something like this:
<script src="apiWrapper.js"></script>
<script>
apiWrapper.init('api_key');
apiWrapper.doSomethingElse();
</script>
Essentially, have a singleton style object in a page that I can add methods and properties too and have available from anywhere within the page.
What's the best way to do this?