src code

class method SpahQL.DataHelper.mathCompare

SpahQL.DataHelper.mathCompare(left, right, callback) → Boolean result
  • left (Object, Array, Boolean, String, Number, null): The value at the left-hand side of the comparator
  • right (Object, Array, Boolean, String, Number, null): The value at the right-hand side of the comparator
  • callback (Function): A callback function which will be evaluating the mathematical comparison.

Compares two objects of any type under the rules of Spah comparisons - both objects must be the same type, and no type coercion will take place. The given callback function should accept two values as an argument and return the comparison result.

Mostly used as a refactoring tool to wrap the global math comparison rules.