Skip to content

Instantly share code, notes, and snippets.

@fat
Created October 26, 2012 03:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fat/3956766 to your computer and use it in GitHub Desktop.
Save fat/3956766 to your computer and use it in GitHub Desktop.
module.exports
module.exports = MyModule;
function MyModule (a, b) {
if (!(this instanceof MyModule)) return new MyModule(a, b);
}
@yornaath
Copy link

the old instanceof switcheroo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment