Created
November 27, 2009 09:23
-
-
Save canonic-epicure/243923 to your computer and use it in GitHub Desktop.
This file contains 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
Class('Name', { | |
//usual methods | |
does : {}, | |
has : {} | |
methods : {}, | |
//class methods/attributes | |
my : { | |
does : {}, | |
has : {} | |
methods : {}, | |
} | |
}) | |
Name.my.someMethod() | |
var name = new Name() | |
name.my.someMethod() | |
//========================= | |
Class('Name', { | |
singleton : true, | |
does : {}, | |
has : {} | |
methods : {}, | |
}) | |
var a = new Name() | |
var b = new Name() | |
var c = Name() | |
a == b == c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment