Skip to content

Instantly share code, notes, and snippets.

@jperrine
Created October 24, 2011 03:10
Show Gist options
  • Save jperrine/1308280 to your computer and use it in GitHub Desktop.
Save jperrine/1308280 to your computer and use it in GitHub Desktop.
note js 2
var QwikObject = function (id, x, y, z) {
this._x = x || 0;
};
QwikObject.prototype = {
get x(){
return this._x;
},
set x(x){
this._x = x;
}
};
QwikObject.prototype.left = function() { return this._x + 'px'; }
obj = new QwikObject(null, 5);
obj.left();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment