ContentsIntroductionBasic JavaScript: values, variables, and control flowFunctionsData structures: Objects and ArraysError HandlingFunctional ProgrammingSearchingObject-oriented ProgrammingModularityRegular ExpressionsWeb programming: A crash courseThe Document-Object ModelBrowser EventsHTTP requestsAppendicesMore (obscure) control structuresBinary HeapsAlphabetic index of terms Cover page
출처 : http://javascript.crockford.com/prototypal.html Object.prototype.begetObject = function () { function F() {} F.prototype = this; return new F(); }; newObject = oldObject.begetObject(); if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {} F.prototype = o; return new F(); }; } newObject = Object.create(oldObject);
1) Our Goal 2) Defining Functions 3) Named Functions 4) Functions as Objects 5) Context 6) Instantiation 7) Flexible Arguments 8) Closures 9) Temporary Scope 10) Function Prototypes 11) Instance Type 12) Inheritance 13) Built-in Prototypes 14) Enforcing Function Context