Created
December 11, 2017 04:48
-
-
Save SebGogo/b75451ec2fee745404df495926a99af8 to your computer and use it in GitHub Desktop.
Function Expression
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
// 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