Files
30-seconds-of-code/snippets/arrayMin.md
2017-12-22 22:44:51 +05:30

236 B

arrayMin

Returns the minimum value in an array.

Use Math.min() combined with the spread operator (...) to get the minimum value in the array.

const arrayMin = zzarr => Math.min(...arr);
// arrayMin([10, 1, 5]) -> 1