inheritance pattern1 28Dec2019 TIL Today I learned : inheritance Pattern (Pseudo-classical / ES6 class) .bind //functional var makeDancer = (timeBetweenSteps) => { const dancer = {}; dancer.step = () => { setTimeout(dancer.step, timeBetweenSteps); }; } //pseudo-classical var Dancer = function (timeBetweenSteps) { this.timeBetweenSteps = timeBetweenSteps; }; Dancer.prototype.step = function () { setTimeout(this.step.bind(step, thi.. 2019. 12. 29. 이전 1 다음