Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created November 12, 2012 21:55
Show Gist options
  • Save ahoward/4062214 to your computer and use it in GitHub Desktop.
Save ahoward/4062214 to your computer and use it in GitHub Desktop.
my latest favorite way to declare js classes...
//
var Grid = new Function();
Grid.initialize = function(){
var args = Array.prototype.slice.apply(arguments);
var grid = new Grid();
grid.initialize.apply(grid, args);
return grid;
};
Grid.prototype.initialize = function(){
var args = Array.prototype.slice.apply(arguments);
var grid = this;
// initialize that bad boy...
};
@ahoward
Copy link
Author

ahoward commented Nov 12, 2012

sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment