Skip to content

Instantly share code, notes, and snippets.

@anxiousmodernman
Last active August 29, 2015 14:21
Show Gist options
  • Save anxiousmodernman/931f67845496b90826a5 to your computer and use it in GitHub Desktop.
Save anxiousmodernman/931f67845496b90826a5 to your computer and use it in GitHub Desktop.
How Douglas Crockford Makes JS objects
/*
* spec parameter is some JSON object with all the params you need
*/
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