Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Guard Statement

var i = 2

while (i <= 10) {
    
  // guard condition to check the even number 
  guard i % 2 == 0 else {
   
     i = i + 1
    continue
  }

  print(i)
  i = i + 1
}
 
PREVIOUS NEXT
Tagged: #Swift #Guard #Statement
ADD COMMENT
Topic
Name
3+7 =