Pernyataan Guard Swift di dalam suatu fungsi
// create a function
func checkOddEven() {
var number = 23
// use of guard statement
guard number % 2 == 0 else {
print("Odd Number")
return
}
print("Even Number")
}
// function call
checkOddEven()
SAMER SAEID