Created
July 1, 2017 00:31
-
-
Save jonathanhawleypeters/32982dd9e2446bea6c75b5f0111dba03 to your computer and use it in GitHub Desktop.
This is Why I Love Fat Arrow Functions in ES6 #3
This file contains hidden or 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
var Cat = function() { | |
this.name = ‘Fluffball’; | |
this.emote = ‘meow’; | |
setInterval(()=>{ | |
console.log(this.emote); | |
}, 2000) | |
}; | |
var myNewCat = new Cat(); //meow, meow, meow… every 2 seconds ad infinitum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment