Skip to content

Instantly share code, notes, and snippets.

@SebGogo
Created December 11, 2017 04:48
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 SebGogo/b75451ec2fee745404df495926a99af8 to your computer and use it in GitHub Desktop.
Save SebGogo/b75451ec2fee745404df495926a99af8 to your computer and use it in GitHub Desktop.
Function Expression
// Function Expression with variable function's name, ()'s holding two parameters, and {} body
const isGreaterThan = (numberOne, numberTwo) => {
// Conditional statement to see if parameter1 is greater than parameter2
if (numberOne > numberTwo) {
return true;
} else {
return false;
}
// Adding semi colon since we are holding this function within a variable
};
// Calling function isGreaterThan with different arguments
console.log(isGreaterThan(1, 2));
console.log(isGreaterThan(2, 1));
console.log(isGreaterThan(2, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment