* @returns
*/
function loopMax (values) {
- let max = -Infinity
+ let maximum = -Infinity
for (const value of values) {
- if (value > max) max = value
+ if (value > maximum) maximum = value
}
- return max
+ return maximum
}
/**
* @returns
*/
function reduceTernaryMax (values) {
- return values.reduce((a, b) => (a > b ? a : b), -Infinity)
+ return values.reduce(
+ (maximum, num) => (maximum > num ? maximum : num),
+ -Infinity
+ )
}
/**
* @returns
*/
function reduceMathMax (values) {
- return values.reduce((a, b) => Math.max(a, b), -Infinity)
+ return values.reduce((maximum, num) => Math.max(maximum, num), -Infinity)
}
/**
* @returns
*/
function loopMin (values) {
- let min = Infinity
+ let minimum = Infinity
for (const value of values) {
- if (value < min) min = value
+ if (value < minimum) minimum = value
}
- return min
+ return minimum
}
/**
* @returns
*/
function reduceTernaryMin (values) {
- return values.reduce((a, b) => (a < b ? a : b), Infinity)
+ return values.reduce(
+ (minimum, num) => (minimum < num ? minimum : num),
+ Infinity
+ )
}
/**
* @returns
*/
function reduceMathMin (values) {
- return values.reduce((a, b) => Math.min(a, b), Infinity)
+ return values.reduce((minimum, num) => Math.min(minimum, num), Infinity)
}
/**