Function objValues

  • Returns an iterable of the values of the given object.

    Type Parameters

    • V

    Parameters

    • obj: Record<ObjectKey, V>

      The object whose values should be returned.

    Returns Iterable<V>

    An iterable that yields all the values of the given object.

    Remarks

    This function uses the Object.values() method to get all the values of the object and then yields them one by one.

    Typeparam

    V - The type of the values in the object.

    Example

    const obj = { a: 1, b: 2, c: 3 };
    const values = objValues(obj);
    for (const value of values) {
    //=> {value}
    }
    // Output:
    // 1
    // 2
    // 3

Generated using TypeDoc