Last active
August 15, 2019 11:37
-
-
Save artemhp/d36d75b4d493156d9cc2814a8bca01ec to your computer and use it in GitHub Desktop.
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
const dog = function(valor){ | |
let iterator = 0; | |
const log = () => iterator++; | |
this.total = () => console.log(iterator); | |
this.bite = (dish) => { | |
console.log(`Om-Nom-nom ${dish}`); | |
log(); | |
return this; | |
} | |
this.woof = function(command){ | |
console.log(`${command}`); | |
log(); | |
return this; | |
} | |
return this; | |
}; | |
dog().woof('aggrr..').woof('woof').bite('ahm') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment