Not looking for zip(), as I have multiple arrays:
var cellphones = [IPhone(), Galaxy()]
var laptops = [Macbook(), Ideapad()]
And I want to iterate over them all in any order:
cellphones.forEach { device in
var multiple = lines()
ofCode()
thatDontNeedToKnowIfPhoneOrLaptop(device)
}
laptops.forEach { device in
var multiple = lines()
ofCode()
thatDontNeedToKnowIfPhoneOrLaptop(device)
}
How would I do this without having to repeat the loop bodies?