1

I am learning Javascript and I am currently looking at the source code of the CryptoJS library on gitub.

I saw this line

var CryptoJS = CryptoJS || (function (Math, undefined) {

}()(Math);

What does this do? Is this a constructor function or what?

Now imagine I have function variables inside of this like below

var CryptoJS = CryptoJS || (function (Math, undefined) {
      var callMeFromOutside = function(){};
}()(Math);

Can I do something like

CryptoJS.callMeFromOutSide();

Please I'm a new bie.

Thanks

mekings
  • 361
  • 3
  • 17

0 Answers0