valuesIn.js 681 B

12345678910111213141516171819202122232425262728293031
  1. var baseValues = require('../internal/baseValues'),
  2. keysIn = require('./keysIn');
  3. /**
  4. * Creates an array of the own and inherited enumerable property values
  5. * of `object`.
  6. *
  7. * **Note:** Non-object values are coerced to objects.
  8. *
  9. * @static
  10. * @memberOf _
  11. * @category Object
  12. * @param {Object} object The object to query.
  13. * @returns {Array} Returns the array of property values.
  14. * @example
  15. *
  16. * function Foo() {
  17. * this.a = 1;
  18. * this.b = 2;
  19. * }
  20. *
  21. * Foo.prototype.c = 3;
  22. *
  23. * _.valuesIn(new Foo);
  24. * // => [1, 2, 3] (iteration order is not guaranteed)
  25. */
  26. function valuesIn(object) {
  27. return baseValues(object, keysIn(object));
  28. }
  29. module.exports = valuesIn;