// you can just use the max function on an array to find the max arr = [1, 7, 3, 9] max(arr) // returns 9 because it is the largest