Skip to content

Instantly share code, notes, and snippets.

@sgentile
Created December 12, 2011 19:48
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 sgentile/1468775 to your computer and use it in GitHub Desktop.
Save sgentile/1468775 to your computer and use it in GitHub Desktop.
Extending Object
function Foo(options) {
if (!(this instanceof Foo)) {
return new Foo(options);
}
options = options || {};
$.extend(this, {
Id: 0,
Bar: null,
Bars: []
}, options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment