Math.max() 可取得多個數字中的最大值,Math.min() 則取得最小值。
Math.max(4, -5, 0.6); // 4 Math.min(4, -5, 0.6); // -5
使用方法時,將數字以逗號分隔即可,不必自行撰寫比較函式。