Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




func max(xs) {
    var y
    for x in xs {
        if y == nil || x > y {
            y = x
        }
    }
    y
}
 
var xs = [1..10]
max(xs)