Skip to content

Instantly share code, notes, and snippets.

@Prinzhorn
Created August 13, 2014 06:48
Show Gist options
  • Select an option

  • Save Prinzhorn/db302a92fbbe082a0c75 to your computer and use it in GitHub Desktop.

Select an option

Save Prinzhorn/db302a92fbbe082a0c75 to your computer and use it in GitHub Desktop.
Functions for checking if an int is equal to another int. So intuitive!
for(var i = 0; i < 4294967296; i++) {
global['is' + i] = (function(i) {
return function(n) {
return !(i - n);
};
}(i));
}
console.log(is5(5));//true
console.log(is5(9));//false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment