Last active
March 18, 2017 23:38
-
-
Save twhite96/3425ef36ca75c93d6ce189a4899ccf40 to your computer and use it in GitHub Desktop.
Arrow Functions with No Args
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 name = "Andrew"; | |
const sayName = function() { | |
const message = "My name is " + name; | |
console.log(message); | |
} | |
// Two lines of code, cannot reduce to one line. | |
const sayName = () => { | |
const message = "My name is " + name; | |
console.log(message); | |
} | |
const sayBye = () => { | |
console.log("Bye " + name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment