Function polyObjEntries

  • Returns an array of key/values of the enumerable properties of an object

    Type Parameters

    • T = any

    Parameters

    • value: {} | {
          [s: string]: T;
      } | ArrayLike<T>

      Object that contains the properties and methods.

    Returns [string, T][]

    0.9.7

    polyObjEntries({ Hello: "Darkness", my: "old", friend: "." });
    // [ [ "Hello", "Darkness" ], [ "my", "old"], [ "friend", "." ] ]

    // Array-like object
    polyObjEntries({ 0: "a", 1: "b", 2: "c" }));
    // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]

    // Array-like object with random key ordering
    polyObjEntries({ 100: "a", 2: "b", 7: "c" });
    // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ]*