Skip to content

Instantly share code, notes, and snippets.

@artemhp
Last active August 15, 2019 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artemhp/d36d75b4d493156d9cc2814a8bca01ec to your computer and use it in GitHub Desktop.
Save artemhp/d36d75b4d493156d9cc2814a8bca01ec to your computer and use it in GitHub Desktop.
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