identity.js 355 B

1234567891011121314151617181920
  1. /**
  2. * This method returns the first argument provided to it.
  3. *
  4. * @static
  5. * @memberOf _
  6. * @category Utility
  7. * @param {*} value Any value.
  8. * @returns {*} Returns `value`.
  9. * @example
  10. *
  11. * var object = { 'user': 'fred' };
  12. *
  13. * _.identity(object) === object;
  14. * // => true
  15. */
  16. function identity(value) {
  17. return value;
  18. }
  19. module.exports = identity;