Skip to content

Instantly share code, notes, and snippets.

@ayuthmang
Last active June 1, 2018 15:59
Show Gist options
  • Save ayuthmang/68d34d5f5953f280d7709ed518dc1b84 to your computer and use it in GitHub Desktop.
Save ayuthmang/68d34d5f5953f280d7709ed518dc1b84 to your computer and use it in GitHub Desktop.
Javascript function claration
// Function Declarations
function sum(a, b) {
return a + b
}
// Function Expressions
const sum = function(a, b) {
return a + b;
}
// Function Expressions
const sum = (a, b) => {
return a + b;
}
// Function Expressions
const sum = (a, b) => a + b;
// Function Constructors
const sum = new Function('return arguments[0] + arguments[1]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment