Last active
September 28, 2022 09:10
-
-
Save nmbr73/8cdf52091743ed63feea0fdbea66192c to your computer and use it in GitHub Desktop.
Day 14, Checkpoint 9 of #100DaysOfSwiftUI ... where @twostraws provided some excellent content again! #HACKINGWITHSWIFT https://www.hackingwithswift.com/quick-start/beginners/checkpoint-9
This file contains 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
func f(_ array: [Int]? ) -> Int { | |
return array?.randomElement() ?? Int.random(in: 1...100) | |
} | |
f(nil) | |
f([Int]()) | |
f([-1,-2,-3]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment