I'm not an expert on JS by any means and I'm learning this along with you ABM
While looking through the original code you provide a lightbulb went off in my head. I've worked with this before. Not exactly, but kind of. Let's say you want to pass the IDs of 3 elements to a named function and turn them into variables for use within that function. Here's what you do:
The event can be anything: onblur, onfocus, onload, etc.
The JS function will look something similar to:
// do your stuff here. var a now equals document.getElementById("id1"), etc.
This looks to be a mechanism to do the same within an unnamed function. If you take out all the stuff in the braces in your twitter example it would look like this:
So var d now equals document, s equals "script" and id equals "twitter-wjs".
If there's no IDs or variables to work with, I guess you leave both sets of parentheses blank as in ().
Take my uneducated WAG for what it's worth....