DAY #26

Swift has “where” clauses that allow you to put logic in loop statements and extensions

1
2
3
4
5
6
7
let list = Array(0...100)

for x in list where x < 50 {
    print(x)
}

// For an example with extensions, see day #10!

Originally published 09/11/2021 @ https://pittcsc.org/ Discord

Published here on 09/09/2022. Blog published date reflects the original date of publication.