Created
February 15, 2011 23:02
-
-
Save voodootikigod/828469 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ClosurePattern() { | |
this.someMethod = function someMethod() { | |
console.log('foo'); | |
} | |
} | |
var closurePattern = new ClosurePattern(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wouldn't call this the closure pattern. It's just a really inefficient way to put functions on an object. Rather, I would do:
But, yeah, the same performance rules apply as the original.