Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/toPairs

Index

References

Functions

References

Renames and re-exports toPairs

Functions

  • Converts an object into an array of key, value arrays. Only the object's own properties are used. Note that the order of the output array is not guaranteed to be consistent across different JS platforms.

    example
     toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]
    

    Type parameters

    • K: string | number | symbol

    • V

    Parameters

    • obj: Record<K, V>

      The object to extract from

    Returns KeyValuePairs<K & string, V>

    An array of key, value arrays from the object's own properties.

Generated using TypeDoc