Function fromEntries

  • The inverse of entriesis method returns an object composed from key-value pairs.

    Type Parameters

    • T

    Parameters

    • pairs: Entry<T>[]

      The key-value pairs.

    Returns {
        [key: string]: T;
    }

    Returns the new object.

    • [key: string]: T

    5.10.0

    fromEntries([['a', 1], ['b', 2]])
    // => { 'a': 1, 'b': 2 }