Skip to content

Instantly share code, notes, and snippets.

@arrbxr
Created April 25, 2018 13:20
Show Gist options
  • Select an option

  • Save arrbxr/0792bf7279fccdd660a4fc066534af0d to your computer and use it in GitHub Desktop.

Select an option

Save arrbxr/0792bf7279fccdd660a4fc066534af0d to your computer and use it in GitHub Desktop.
javaScript function four ways created by arrbxr - https://repl.it/@arrbxr/javaScript-function-four-ways
// JavaScript Function Four Ways
// Function declaration
function square(x){
return x * x;
}
// Function Expression
const square = function(x){
return x * x;
}
// Arrow Function Expression
const square = (x) => {
return x * x;
}
//Concise Arrow Funcrion Expression
const square = x => x*x;
square(6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment