Skip to content

Instantly share code, notes, and snippets.

@ajpiano
Forked from rwaldron/iife.js
Created April 29, 2011 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajpiano/948365 to your computer and use it in GitHub Desktop.
Save ajpiano/948365 to your computer and use it in GitHub Desktop.
Running collection of IIFE Patterns
(function( window, document, undefined ){
})( this, this.document );
(function( global, undefined ){
})( this );
// miketaylr
(function( win, doc ){
// SCREW U UNDEFINED
})( window, document );
// ralphholzmann
(function poll() {
/* Lots of stuffs here */
if ( cssIsReady ) {
cssCallback();
} else {
setTimeout( poll, 50 );
}
})();
// mennovanslooten
new function() {
// No arguments though
}
// addyosmani
(function(){
arguments.callee();
}());
(function(){
/* do stuff */
}());
// ajpiano
// parse and store returned json data into a reusable html structure
someobject.prop = (function() {
return someobject.prop.map(function(o) {
return "<li>"+o+"</li>";
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment