Skip to main content

$void

The $void operator returns the void (nil) value, typically used for early exits in block operations.

Input

  • No parameters required

Output

  • The void (nil) value

Examples

Basic Usage

{
  "$void": []
}
Result: null

Using in a Block

{
  "$block": [
    {
      "$let": [
        "x",
        10
      ]
    },
    {
      "$ifelse": [
        {
          "$gt": [
            {
              "$var": ["x"]
            },
            5
          ]
        },
        {
          "$void": []
        },
        {
          "$var": ["x"]
        }
      ]
    }
  ]
}
Result: null if x is greater than 5 (with early exit), otherwise the value of x