Function objEntries

  • Returns an iterable of key-value pairs from the given object.

    Type Parameters

    • V

    Parameters

    • obj: Record<ObjectKey, V>

      The object to iterate over.

    Returns Iterable<[string, V]>

    An iterable of tuples where each tuple is a key-value pair from the object.

    Remarks

    This function is a part of Object Utilities.

    Typeparam

    V - The type of values in the object.

    Example

    const obj = { a: 1, b: 2, c: 3 };
    for (const [key, value] of objEntries(obj)) {
    //=> a //=> b //=> c 3
    }

Generated using TypeDoc