Answers for "how to search the maximum number in an array javascrit"

2

Find the maximum number of an array js

var arr = [1, 2, 3];
var max = arr.reduce(function(a, b) {
  return Math.max(a, b);
});
Posted by: Guest on October-22-2020
0

Max Number from Array in JS

function arrayMax(array) {
  return array.reduce(function(a, b) {
    return Math.max(a, b);
  });
}

function arrayMin(array) {
  return array.reduce(function(a, b) {
    return Math.min(a, b);
  });
}
Posted by: Guest on November-04-2021

Code answers related to "how to search the maximum number in an array javascrit"

Code answers related to "Javascript"

Browse Popular Code Answers by Language