Created
January 24, 2014 17:04
-
-
Save slopeofhope81/8601532 to your computer and use it in GitHub Desktop.
/*Write a function greaterThan, which takes one argument, a number, and returns a function that represents a test. When this returned function is called with a single number as argument, it returns a boolean: true if the given number is greater than the number that was used to create the test function, and false otherwise.*/
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 greaterThan(num) { | |
return function test(num1) { | |
if (num > num1) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
} | |
var find = greaterThan(100); | |
document.write(find(3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment