Skip to content

Instantly share code, notes, and snippets.

@slopeofhope81
Created January 24, 2014 17:04
Show Gist options
  • Save slopeofhope81/8601532 to your computer and use it in GitHub Desktop.
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.*/
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