You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
361 B

4 years ago
  1. # `min()`
  2. The min method returns the minimum value of a given key:
  3. ```js
  4. const collection = collect([
  5. {
  6. worth: 100,
  7. },
  8. {
  9. worth: 900,
  10. },
  11. {
  12. worth: 79,
  13. },
  14. ]);
  15. collection.min('worth');
  16. // 79
  17. ```
  18. ```js
  19. collect([1, 2, 3, 4, 5]).min();
  20. // 1
  21. ```
  22. [View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/min.js)