ts-data-forge
    Preparing search index...

    Function isUndefined

    • Type guard that checks if a value is undefined.

      Type Narrowing Behavior:

      • Narrows the input type to undefined when true
      • Useful for explicit undefined checks

      Parameters

      • u: unknown

        The value to check

      Returns u is undefined

      true if u is undefined, false otherwise. When true, TypeScript narrows the type to undefined.

      const values: (number | undefined)[] = [1, undefined, 2];

      const undefinedValues = values.filter(isUndefined);

      assert.deepStrictEqual(undefinedValues, [undefined]);