Logos DX
    Preparing search index...

    Function isPlainObject

    • Checks if value is an uncommon object. Used to determine if a value is a user defined object.

      Parameters

      • a: unknown

        value to check

      Returns a is object

      true if value is an uncommon object

      // Returns false for common objects
      isPlainObject(new Date()) // false
      isPlainObject(new RegExp('')) // false
      isPlainObject(new Function()) // false
      isPlainObject(new Error()) // false
      isPlainObject(new Array()) // false
      isPlainObject(new Set()) // false

      // Returns true for uncommon objects
      isPlainObject({}) // true
      isPlainObject(new MyClass()) // true