JavaScriptNumberMath.max

Returns the largest of the given numbers.

문법

Math.max(...values)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

console
Math
const
arr
console.log(Math.max(1, 3, 2, 5, 4));   // 5
const arr = [1, 3, 2, 5];
console.log(Math.max(...arr));           // 5