i'm in a web development class. it's for my major, but i've been doing this for years so very little is earth shattering for me. as the teacher was explaining embedding from a very beginner standpoint, i saw something that confuses the hell out of me. it's the way twitter uses javascript to allow a user to embed their widgets on webpages. this is that script:

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
everything between the curly braces {} i get. no problem got it.

it's everything else that confuses me. my first search led me to stackoverflow, which is why i titled my thread like i did:


okay, got it. the exclamation point makes the statement an expression. cool great.

but i guess that makes me confused about this:

or i guess that's the same as:

!function {}()
so my ultimate question, especially if you can answer it in the context of the twitter code i provided, is what does the second set of parenthesis () do?? how does that modify the function or help the page or whatever??