Skip to content

Instantly share code, notes, and snippets.

@sean-roberts
Created May 31, 2013 01:14
Show Gist options
  • Save sean-roberts/5682406 to your computer and use it in GitHub Desktop.
Save sean-roberts/5682406 to your computer and use it in GitHub Desktop.
Safe self invoking function wrapper! Suuhhweet! This is actually a way to create a type of Namespace in Javascript
//version without passing in parameters that are not available in the function scope
;(function(){
//code here
//why the leading semi colon?
// this is a safe way to keep from having conflicts with other code that uses the same
// self invoking functions but left off the colon
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment