Skip to content

Unexpected behavior: undefined = undefined evaluates to false #772

Description

@benny779

In JavaScript, both equality operators treat undefined as equal to itself:

undefined == undefined   // true
undefined === undefined  // true

However, in JSONata the following expression evaluates to false:

undefined = undefined

This behavior is surprising and may lead to unexpected results when comparing missing values.

Expected behavior

undefined = undefined should evaluate to true, or the documentation should clearly explain the rationale for the current behavior.

Actual behavior

The expression evaluates to false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions