This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: HIGHER ORDER FUNCTION | |
let bookBefore2020HOF = books.filter({$0.year < 2000}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MARK: IF FILTER | |
var bookBefore2000 = [Book]() | |
for book in books { | |
if book.year < 2000 { | |
bookBefore2000.append(book) | |
} | |
} |
NewerOlder