* Returns the maximum value in a Series * @example * ``` * const sf = new Series([1, 2, 3, 4, 5, 6]); * console.log(sf.max()); * //output 6 * ```
()
| 561 | * ``` |
| 562 | */ |
| 563 | max(): number { |
| 564 | const values = this.$checkAndCleanValues(this.values as ArrayType1D, "max") |
| 565 | let biggestValue = values[0] |
| 566 | for (let i = 0; i < values.length; i++) { |
| 567 | biggestValue = biggestValue > values[i] ? biggestValue : values[i] |
| 568 | } |
| 569 | return biggestValue |
| 570 | } |
| 571 | |
| 572 | /** |
| 573 | * Return the sum of the values in a series. |