• Iterates the object by keys

    Example

    const users = {
    fred: { user: "fred", age: 40 },
    pebbles: { user: "pebbles", age: 1 }
    };
    forEach(users, u => console.log(u.age)); // console logs 40 and 1

    Type Parameters

    • T extends Record<string, unknown>

    • K extends string | number | symbol

    Parameters

    • obj: T
    • fn: ((value: T[K], key: K, object: T) => void)
        • (value: T[K], key: K, object: T): void
        • Parameters

          • value: T[K]
          • key: K
          • object: T

          Returns void

    Returns void

Generated using TypeDoc