This file contains 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
var makeCounter = function() { | |
var i = 0; | |
return function() { return i += 1 }; | |
} | |
var c1 = makeCounter(), | |
c2 = makeCounter(); | |
c1(); // 1 | |
c1(); // 2 | |
c1(); // 3 | |
c2(); // 1 | |
c1(); // 4 | |
c2(); // 2 |
'DevLogs' 카테고리의 다른 글
dump memcached in linux shell (0) | 2017.08.24 |
---|---|
텔레그램(Telegram) CLI를 사용하여, 자동으로 메시지 보내기 (0) | 2017.08.21 |
Change Node.js Express View Engine from jade to pug (0) | 2017.08.19 |
vagrant를 활용한 django 초기 세팅 커맨드 정리 (0) | 2017.08.19 |
한글 win10에서 vagrant up 실행 오류 케이스 (0) | 2017.08.19 |