Answers for "Find the maximum number of an array js"

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
10

javascript get array min and max

//get min/max value of arrays
function getArrayMax(array){
   return Math.max.apply(null, array);
}
function getArrayMin(array){
   return Math.min.apply(null, array);
}
var ages=[11, 54, 32, 92];
var maxAge=getArrayMax(ages); //92
var minAge=getArrayMin(ages); //11
Posted by: Guest on July-31-2019
1

Find the maximum number of an array js

function getMaxOfArray(numArray) {
    return Math.max.apply(null, numArray);
}
Posted by: Guest on October-22-2020
1

function that search a biggest value in array javascript

function maisBaratosQue(valor, precos) {
   return precos.filter(p => p <= valor);
}
Posted by: Guest on September-18-2020
0

maximum number of an array

var arr = [1, 2, 3];
var max = Math.max(...arr);
Posted by: Guest on May-22-2021
0

Find the maximum number of an array js

Math.max(10, 20);   //  20
Math.max(-10, -20); // -10
Math.max(-10, 20);  //  20
Posted by: Guest on October-22-2020

Code answers related to "Find the maximum number of an array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language