Created
December 12, 2011 19:48
-
-
Save sgentile/1468775 to your computer and use it in GitHub Desktop.
Extending Object
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
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