pairsIn source npm

_.pairsIn(object)

Creates an array of own and inherited enumerable key-value pairs for object.

Arguments

  1. object (Object)

    The object to query.

Returns (Array)

Returns the new array of key-value pairs.

Example

function Foo() {
  this.a = 1;
  this.b = 2;
}

Foo.prototype.c = 3;

_.pairsIn(new Foo);
// => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)