Skip to content

Instantly share code, notes, and snippets.

@scottcorgan
Created November 20, 2014 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scottcorgan/22aa72166ce2cac324d7 to your computer and use it in GitHub Desktop.
Save scottcorgan/22aa72166ce2cac324d7 to your computer and use it in GitHub Desktop.
Douglas Crockford's new constructor without using new
function constructor(spec) {
let { member } = spec,
{ other } = other_constructor(spec),
method = function() {
// member, other, methid, spec
};
return Object.freeze({
method,
other
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment