Hacker News new | ask | show | jobs
by tothepixel 4421 days ago
To extend upon this, you can also pass in references to decrease lookup time. That's why you see people doing:

   (function($,window) {
     //code here
   })(jQuery,window);
1 comments

This reduces size after uglifying.

  (function(window, $, otherGlobal) {  
     $ = window.jQuery;
     otherGlobal = window.otherGlobal;

     //code here
  })(window);