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
haracter(s) Pattern Ex. String Ex. (Pattern matches in red) Example Description & Jsfiddle Type Meta Characters ^ /^Cat/ Cat go fast string must start with Catjsfiddle anchor $ /slow$/ Dogs are slow string must end with slowjsfiddle anchor * /bo*/ boom and boat and bug matches when the precedingo occurs 0 or more timesjsfiddle quantifier + /bo+/ boom and boat and bug matches when the precedingo ..
쿠키 메서드 // 쿠키 객체 var Cookies = { create: function(key, value, expires) { var date = new Date(); date.setTime(date.getTime() + (expires * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); var path = "; path=/" var domain = "; domain=" + document.domain; document.cookie = key + "=" + value + expires + domain + path; }, read: function(key) { var keyString = key + "="; var cooki..