Languages
[Edit]
EN

JavaScript - how to find min value in array with Array reduce method?

7 points
Created by:
JustMike
26120

Using JavaScript it is possible to find minimum value in array in following way.

1. Array reduce method example

// ONLINE-RUNNER:browser;

var array = [1, 2, 3];

var result = array.reduce(function(a, b) {
    return Math.min(a, b);
});

console.log(result);

See also

  1. JavaScript - Math.min() method example
Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join