Logos DX
    Preparing search index...

    Function hasNoConstructor

    • Checks if value is a type that does not have a constructor.

      Tests for null and undefined values which lack constructors. Useful for deep comparison and cloning operations.

      Parameters

      • val: unknown

        value to check

      Returns boolean

      true if value has no constructor (null or undefined)

      hasNoConstructor(null) // true
      hasNoConstructor(undefined) // true
      hasNoConstructor({}) // false
      hasNoConstructor('string') // false
      hasNoConstructor(42) // false