• + 0 comments

    using an if statement inside the for loop will just contribute in complexity. you can replace it with Math.max function.