Skip to content

Instantly share code, notes, and snippets.

@chalu
Created July 18, 2019 18:05
Show Gist options
  • Save chalu/fb7a0a489918ad419fabb47de489fe97 to your computer and use it in GitHub Desktop.
Save chalu/fb7a0a489918ad419fabb47de489fe97 to your computer and use it in GitHub Desktop.
const is = (target) => (value) => value === target;
const isOver = (target) => (value) => value > target;
const isUnder = (target) => (value) => value < target;
const isOrOver = (target) => (value) => value >= target;
const isOrUnder = (target) => (value) => value <= target;
const isMultipleOf = (target) => (value) => value % target === 0;
// thus, easy to make isEven, isOdd, isPrime, isEnabled, isConnected, isStared
// isFavorite, is404, isImageResponse e.t.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment