Last active
November 26, 2017 12:21
-
-
Save nikkaroraa/4dfbb43cc39482379f9b37908bae7bd3 to your computer and use it in GitHub Desktop.
Fat-Arrow Function
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
| //Old syntax of defining functions | |
| var blogTitle = function getBlogTitle(id) { | |
| console.log(blog[id].title); | |
| } | |
| blogTitle(2); | |
| //Fat-Arrow syntax | |
| var blogTitle = id => console.log(blog[id].title); | |
| blogTitle(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment