matheus-rodrigues00 / utils

✨ Library to commonly used cross-projects utilities methods ✨
17 stars 11 forks source link

Create max Method #50

Closed matheus-rodrigues00 closed 1 year ago

matheus-rodrigues00 commented 1 year ago

Create a new method called max. This method should compute the maximum value of an array. If the array is empty or falsy, it should return undefined.

function max(arr: number[] | undefined): number | undefined {
    // Implementation goes here
}
matheus-rodrigues00 commented 1 year ago

Close by PR #54