| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Math/max | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
Math.max() ,
-Infinity .
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
Math.max()
Math.max(value1)
Math.max(value1, value2)
Math.max(value1, value2, /* , */ valueN)
value1, , valueN0 .
max() Math Math
Math.max() . (Math ).
Math.max.length 2 , 2 .
Math.max(10, 20); // 20
Math.max(-10, -20); // -10
Math.max(-10, 20); // 20
const arr = [1, 2, 3];
const max = arr.reduce((a, b) => Math.max(a, b), -Infinity);
Function.prototype.apply() . getMaxOfArray([1, 2, 3]) Math.max(1, 2, 3) , getMaxOfArray() . .
function getMaxOfArray(numArray) {
return Math.max.apply(null, numArray);
}
const arr = [1, 2, 3];
const max = Math.max(...arr);
(...) apply
. apply .
reduce .
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-math.max |
This page was last modified on 2025 2 11 by MDN contributors.
MathMath.abs()Math.acos()Math.acosh()Math.asin()Math.asinh()Math.atan()Math.atan2()Math.atanh()Math.cbrt()Math.ceil()Math.clz32()Math.cos()Math.cosh()Math.exp()expm1()Math.f16round()Math.floor()Math.fround()hypot()Math.imul()Math.log()log1p()Math.log2()Math.log10()Math.max()Math.min()Math.pow()Math.random()Math.round()Math.sign()Math.sin()Math.sinh()Math.sqrt()sumPrecise()Math.tan()Math.tanh()Math.trunc()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |