Skip to content

Unexpected behavior: undefined = undefined evaluates to false #772

@benny779

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.

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