Created
May 9, 2014 04:27
-
-
Save christabor/2a261a7ef8097ec1a2d4 to your computer and use it in GitHub Desktop.
Python 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
// Python style | |
function Class() { | |
var self = this; | |
this.__init__ = function(x, y){ | |
self.x = x; | |
self.y = y; | |
}; | |
this.__str__ = function(){ | |
log('<' + self.x + self.y + '>'); | |
}; | |
} | |
function init() { | |
var a = new Class(); | |
a.__init__(100, 100); | |
a.__str__(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment