Skip to content

Instantly share code, notes, and snippets.

@myhrvold
Created May 14, 2016 05:29
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 myhrvold/fc09a8f8e14f6387fd8e8c9bc0bb1436 to your computer and use it in GitHub Desktop.
Save myhrvold/fc09a8f8e14f6387fd8e8c9bc0bb1436 to your computer and use it in GitHub Desktop.
Third Example for Ride Policies Uber for Business Article
var evaluateRule = require('./uber-rule-evaluator');
var isInteger = "floor(x) === x";
var floatFact = {
x: 10.5,
floor: Math.floor
};
var intFact = {
x: 10,
floor: Math.floor
}
console.log(evaluateRule(isInteger, floatFact));
console.log(evaluateRule(isInteger, intFact));
// false, true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment