Skip to content

Instantly share code, notes, and snippets.

@SebGogo
Created December 11, 2017 04:21
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/a032f0f4ebe82e6a82cd55a3c6a07414 to your computer and use it in GitHub Desktop.
Save SebGogo/a032f0f4ebe82e6a82cd55a3c6a07414 to your computer and use it in GitHub Desktop.
Function Declarations
// Declaring function with keyword 'function', function's name, ()'s holding two parameters, and {} body
function isGreaterThan (numberOne, numberTwo) {
// Conditional statement to see if parameter1 is greater than parameter2
if (numberOne > numberTwo) {
return true;
} else {
return false;
}
}
// 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