Created
December 20, 2009 16:37
-
-
Save panfu/260551 to your computer and use it in GitHub Desktop.
OO.js
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
function obj(a) { | |
this.a = a; | |
this.b = getB(); | |
function getB() { | |
this.c = 'this is c'; | |
return 'this is b'; | |
} | |
} | |
var o = obj('A'); | |
o.a | |
o.b | |
o.c | |
var f = { | |
a: function() { | |
return this.b | |
}, | |
b: "B here", | |
c: function() { | |
this.a(); | |
this.b += "opopop"; | |
return ; | |
} | |
} | |
f.a(); | |
f.b; | |
f.c(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment