jty
    Preparing search index...

    Function isPOJO

    • Checks if a value is a Plain Old Javascript Object (POJO)

      This function returns false for Array, Map, Set, etc. Basically it only returns true if x is a so called Plain Old Javascript Object.

      Parameters

      • x: unknown

        possibly a POJO

      Returns x is Record<PropertyKey, unknown>

      true if the value is a Plain Old Javascript Object, false otherwise

      isPOJO({}) => true
      isPOJO(Object.create(null)) => false
      isPOJO([]) => false
      isPOJO(new Map()) => false
      isPOJO(new Set()) => false