1

I am trying something and I saw Facebook SDK's code:

(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

Can someone explain to me what does (function(){}()) do? I can't Google it since brackets are consider a syntax on Google.

Daniel Cheung
  • 4,779
  • 1
  • 30
  • 63

0 Answers0