Last active
August 29, 2015 14:21
-
-
Save anxiousmodernman/931f67845496b90826a5 to your computer and use it in GitHub Desktop.
How Douglas Crockford Makes JS objects
This file contains hidden or 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
/* | |
* 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