Skip to content

Instantly share code, notes, and snippets.

@rabmarjan
Created August 25, 2018 18:06
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 rabmarjan/d94deb7e27425970f651c4b587294c0a to your computer and use it in GitHub Desktop.
Save rabmarjan/d94deb7e27425970f651c4b587294c0a to your computer and use it in GitHub Desktop.
var obj = {
count: 0,
cool: function coolFn() {
if (this.count < 1) {
setTimeout( () => { // arrow-function ftw?
this.count++;
console.log( "awesome?" );
}, 100 );
}
}
};
obj.cool(); // awesome?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment