ES6 (2) 썸네일형 리스트형 reuce함수 // a는 previous값, 1+2+3 = 6 [1, 2, 3].reduce((a, b) => { console.log(a, b); return a + c;}, 0); // 0은 초기값 Strategy 패턴 // 실행 Class 정의class Runsea { run() { console.log("바다로 가자"); }}class Runmount { run() { console.log("산으로 가자"); }}// Commane Moduleclass Command { constructor(obj) { this.obj = obj; } run() { this.obj.run(); }}new Command(new Runsea()).run(); // Runsea class 실행new Command(new Runmount()).run(); // Runsea class 실행// Strategy 모듈// setStrategy(strst.. 이전 1 다음