Swift Tips: Zip different sized arrays
Swift uses the first option, the resulting sequence will have a length equal to the shorter of the two inputs.
Creates a sequence of pairs built out of two underlying sequences.
func zip<Sequence1, Sequence2>(_ sequence1: Sequence1,_ sequence2: Sequence2 ) -> Zip2Sequence<Sequence1, Sequence2> where Sequence1 : Sequence, Sequence2 : Sequence
Returna a sequence of tuple pairs, where the elements of each pair are corresponding elements of
let words = ["one", "two", "three", "four"]
let numbers = [1, 2, 3]
let zippedArray = zip(words, numbers)
//zippedArray --> [("one",1),("two",2),("three",3)]