Skip to content

Instantly share code, notes, and snippets.

@christabor
Created May 9, 2014 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christabor/2a261a7ef8097ec1a2d4 to your computer and use it in GitHub Desktop.
Save christabor/2a261a7ef8097ec1a2d4 to your computer and use it in GitHub Desktop.
Python js
// 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