Skip to content

Instantly share code, notes, and snippets.

@squallstar
Created September 24, 2013 09:14
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 squallstar/6682281 to your computer and use it in GitHub Desktop.
Save squallstar/6682281 to your computer and use it in GitHub Desktop.
AMD/CommonJS/Module.exports
if typeof define is 'function' and define.amd
# AMD
define -> MyObject
else if typeof exports is 'object'
# CommonJS
module.exports = MyObject
else
# Global
MyObject.init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment