Skip to content

Instantly share code, notes, and snippets.

@hershmire
Created March 17, 2015 23:49
Show Gist options
  • Save hershmire/e98949e905e4d08ae8f0 to your computer and use it in GitHub Desktop.
Save hershmire/e98949e905e4d08ae8f0 to your computer and use it in GitHub Desktop.
Function object example from Douglas Crawford without prototypical inheritance and the need for `this` for better security. https://www.youtube.com/watch?v=bo36MrBfTk4&t=2143
function constructor(spec) {
var that = other_constructor(spec),
member,
method = function() {
// spec, member, method
};
that.method = method;
return that;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment