클로저는 함수 선언 시 만들어지는 유효 범위를 뜻한다. var outerValue = 'outerValue';var later; function outerFunction() {var innerValue = 'innerValue'; function innerFunction() {console.log('outerValue', outerValue); // outerValueconsole.log('innerValue', innerValue); // innerValue} later = innerFunction;} outerFunction();console.log('innerValue', innerValue);later(); outerFunction 함수와 innerFunction 함수가 생성되면서 각 함수에 대한..
객체란 이름이 있는 값을 의미한다. 객체의 값은 단일 값일 수도 있으며, 객체의 여러 가지의 값을 담고 있을 수도 있다. // 단일 값 예시var object = 1; // 복수의 값을 담고 있는 예시 var object1 = {};object1.living = 'seoul';object1.age = 20; 객체를 생성하는 방법은 여러가지다. 우선 생성자 함수를 활용하여 객체를 생성하는 방법을 살펴보자. 생성자 함수란 미리 객체의 틀(형태)을 만들고 필요할 때 마다 호출하여 특정한 틀을 갖추고 있는 객체를 반환하는 방식이다. var Person = function() {this.living = 'seoul';this.age = 20;} var person = new Person();console.log(..
가끔 void 0 이라는 코드를 보는 경우가 있다. void 0은 무엇인가?? 찬찬히 void 연산자 부터 살펴보자. void는 함수 body의 내용을 실행하고 undefined를 리턴하는 연산자다. void 0이라는 문구는 void(0)과 동일한 코드이며,단지 undefined라는 값을 얻기 위한 코드인 것이다. 그러면 undefined라는 값을 직접 사용하지 않고void 0을 사용한 이유는 무엇일까? JS 초창기 시절 undefined는 writable한 전역 변수였다.(즉, undefined에 값을 할당이 가능) 값이 할당된 undefined로 인한 버그를 막기 위해void 0 이라는 코드를 사용하게된 것이다. 물론 최신 브라우저에서는undefined에 값 할당이 불가하다. 마지막으로 관련 url ..
- Total
- Today
- Yesterday
- 자바스크립트
- Android
- eventbus
- awe-some
- MarionetteJS
- 함수
- angular
- #가상머신
- framework
- common.js
- vue.js
- git tag
- Typescript
- awesome-vue
- marionetts.js
- mocha.js
- browserify
- vue
- AndroidContext
- node
- javascript
- nextTick
- 원하는것이있다면끝까지버텨라
- 외부모듈
- vuex
- node.js
- js
- backbone.js
- nodejs
- 뉴욕
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |