Function foreach

  • Performs the specified operation on all pairs of object keys and values (Object.entries()).

    Parameters

    • object: any
    • callable: ICallable

    Returns void

    Example

    import { foreach } from 'apption'
    let count = 0;
    foreach({ a: 1, b: 2, c: 3 }, (k, v) => count += (v * v));
    console.log(count) // 14