I have a for loop that checks if a number is a factor of a number, then checks if that factor is prime, and then it adds it to an array. Depending on the original number, I wil
SWIIFT 4
The best way to go is to use stride as by this documentation page: Generic Function stride(from:to:by:)
for i in stride(from: 10, through: 5, by: -1) { print(i) }
and stride through if you want to include the lowerBound: Generic Function stride(from:through:by:)