Skip to content

Compare

What It Does

Compares two values using one of several comparison operators. It evaluates the relationship between the inputs and outputs a boolean (true/false) result indicating whether the comparison is satisfied.

Inputs

NameDescriptionTypeRequired
aThe first value to compareAnyYes
bThe second value to compareAnyYes
operatorThe comparison operator to use (=, ≠, >, <, ≥, ≤)TextNo

Outputs

NameDescriptionType
valueThe result of the comparison (true if the comparison is satisfied, false otherwise)Yes/No

How to Use It

  1. Drag the Compare node into your graph.
  2. Connect the first value to compare to the "a" input.
  3. Connect the second value to compare to the "b" input.
  4. Select the desired operator from the dropdown (default is "equal").
  5. Run the graph—the output will be true if the comparison is satisfied, false otherwise.

Supported Operators

OperatorSymbolDescription
Equal=True if a is equal to b
Not EqualTrue if a is not equal to b
Greater Than>True if a is greater than b
Less Than<True if a is less than b
Greater Than or EqualTrue if a is greater than or equal to b
Less Than or EqualTrue if a is less than or equal to b

Tips

  • For string comparison, the operators follow JavaScript's string comparison rules.
  • When comparing objects, "equal" means the same exact object, not just objects with the same properties.
  • Mixing types in comparison may give unexpected results (e.g., comparing a string to a number).

See Also

  • If: For conditionally choosing between two values based on a boolean.
  • And: For combining multiple conditions, requiring all to be true.
  • Or: For combining multiple conditions, requiring at least one to be true.

Use Cases

  • Conditional Logic: Create branching logic based on value comparisons.
  • Data Validation: Check if values meet specific criteria or thresholds.
  • Range Testing: Verify if a value falls within or outside a specific range.