Function objSize

  • Calculates and returns the size of the given object.

    Type Parameters

    • V

    Parameters

    • obj: Record<ObjectKey, V>

      The object whose size is to be calculated.

    Returns number

    The size of the object.

    Remarks

    This function uses Object.keys(obj).length to determine the size of the object.

    Typeparam

    V - The type of the values in the object.

    Example

    objSize({ a: 1, b: 2, c: 3 });;
    //=> 3

Generated using TypeDoc