Skip to content

Instantly share code, notes, and snippets.

@twhite96
Last active March 18, 2017 23:38
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 twhite96/3425ef36ca75c93d6ce189a4899ccf40 to your computer and use it in GitHub Desktop.
Save twhite96/3425ef36ca75c93d6ce189a4899ccf40 to your computer and use it in GitHub Desktop.
Arrow Functions with No Args
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