Answers for "math.max in javascript"

31

javascript biggest number

console.log(Number.MAX_SAFE_INTEGER);
// expected output: 9007199254740991
Posted by: Guest on July-16-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
13

math.max in javascript

Math.max() function returns the largest of the zero or more numbers given as input parameters.
Math.max(1,10,100); // return 100
Posted by: Guest on December-31-2020
6

jsx return greatest number between two numbers

Math.max(5, 10);
Posted by: Guest on April-21-2020
1

find max value in javascript

x = findMax(1, 123, 500, 115, 44, 88);

function findMax() {
  var i;
  var max = -Infinity;
  for (i = 0; i < arguments.length; i++) {
    if (arguments[i] > max) {
      max = arguments[i];
    }
  }
  return max;
}
Posted by: Guest on November-25-2020
1

max method in js

// Math.max
finding maximum number

console.log(Math.max(1, 3, 2));
// expected output: 3

console.log(Math.max(-1, -3, -2));
// expected output: -1

const array1 = [1, 3, 2];

console.log(Math.max(...array1));
// expected output: 3
Posted by: Guest on January-03-2021

Code answers related to "math.max in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language