function을 new하는 메소드는 어떻게 생겼을까? Source if(typeof Object.create !== 'function'){ var Object = function(o){ return { create:function(){ var F = function(){}; F.prototype = o; return new F(); } } }; } Function.prototype.kkk = function() { var that = Object.create(this.prototype); var other = this.apply(that, arguments); return (typeof other === 'object' && other) || that; }; function add() { return ..
0.정의()가 없냐 있느냐에 따라 호출하는 방식과 그것이 의미하는 것이 달라진다. 일단 ()의 의미를 간단하게 실행이라고 생각하고 아래의 예제를 보자. 1.()가 없는 경우 Sourcevar serial_maker = function(){ var prefix=' '; var seq=0; return{ set_prefix:function(p){ prefix = String(p); }, set_seq:function(s){ seq = s; }, gensym:function(){ var result = prefix +seq; seq +=1; console.log(">>" + result); return result; } };};호출방법 var seqer = serial_maker();seqer.set_pref..
Javascript에서의 This는 자바의 개념과는 다르다. 자바에서는 언제나 자기자신을 가르키지만 여기에서는 의미가 계속적으로 변경된다.그래서 아직도 많이 헷갈리고, 아리까리 하지만, 테스트 통해 일단 기본적인 것들을 정의해보려고 한다. 자바스크립에서 function을 콜할 수 있는 방법은 다음과 같이 4가지이다. Function form functionObject(arguments) Method form thisObject.methodName(arguments) thisObject["methodName"](arguments) Constructor form new functionObject(arguments) Apply form functionObject.apply(thisObject, [argumen..
- Total
- Today
- Yesterday
- basement
- BC주
- TORONTO
- 미시사가
- 캐나다
- 부동산분석
- 토론토정착서비스
- 우드워킹
- 정착서비스
- Red Hat
- 옥빌
- BTBS
- Certificate
- RHEL
- Jay
- cert
- ansible
- git proGit
- redhat
- 토론토
- 벌링턴
- Canada
- docker
- 캐나다부동산
- certification
- 온타리오
- RHCE
- 밀튼
- 부모님초청이민
- 인터넷
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |