Math.max

max — Returns the number with the highest value.

Description

Math.max([number number, [number numbers, …]])

Parameters

Name Description Type Default Optional
number number Yes
numbers, … number Yes

Examples

Example #1 – max example
console.log(Math.max(11, 8)); // 11 console.log(Math.max(-2, 3)); // 3 console.log(Math.max(-3, -7)); // -3

See also

External references