Es6-math-max
提供:Dev Guides
ES6-数学max()関数
このメソッドは、ゼロ以上の数の最大値を返します。 引数が指定されていない場合、結果は-Infinityです。
構文
Math.max(x1,x2,x3..)
パラメータ
- X1、x2、x3 .. −一連の数字を表します
例
console.log("---Math.max()---")
console.log("Math.max(3, 0.5, 0.66) : "+Math.max(3, 0.5, 0.66))
console.log("Math.max(-3, 0.5, -0.66) : "+Math.max(-3, 0.5, -0.66))
出力
---Math.max()---
Math.max(3, 0.5, 0.66) : 3
Math.max(-3, 0.5, -0.66) : 0.5