Q:

swift / changing name of variable in loop

How could i change name of variable in loop? 
like number1 , number2, number3, number4 ?
var array = [2,4,6,8]
func ap ( number1: Int , number2: Int , number3: Int , number4: Int ) {
    for (index,_) in array.enumerated() {
    array[index] += **("number\(index)")**
    }
        print(array)
}
ap(number1: 2, number2: 4, number3: 6, number4: 8)

A:

I think this answer says not possible and to use an array instead.
Here is using another array:
var array = [2,4,6,8]

func ap ( number1: Int , number2: Int , number3: Int , number4: Int ) {

    let arrayOfParameters = [number1, number2, number3, number4]

    for (index,_) in array.enumerated() {
        array[index] += arrayOfParameters[index]
    }
    print(array)
}
ap(number1: 2, number2: 4, number3: 6, number4: 8)

prints: [4, 8, 12, 16]

