Created
December 7, 2010 15:43
-
-
Save erubboli/731923 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
<script> | |
function A() { | |
alert("new A called"); | |
this.my_method = function(element) { | |
alert("a#method called"); | |
} | |
}; | |
A.initialize = function() { | |
alert ("A#initialize called"); | |
return function() { | |
alert ("A#initialize returned obj called"); | |
}; | |
} | |
a=new A(); /* new A called */ | |
a.my_method() /* => a#method called*/ | |
obj=A.initialize(); /* => A#initialize called*/ | |
obj(); /* => A#initialize returned obj called*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment