Skip to content

Instantly share code, notes, and snippets.

@IhwanID
Created March 15, 2021 01:22
Show Gist options
  • Save IhwanID/afaefec94d7f42fe04241134ef6153fb to your computer and use it in GitHub Desktop.
Save IhwanID/afaefec94d7f42fe04241134ef6153fb to your computer and use it in GitHub Desktop.
For Where in Swift
let numbers = [1, 2, 3 , 4 , 5, 6]
for number in numbers{
if number.isMultiple(of: 2){
print(number)
}
}
for number in numbers where number.isMultiple(of: 2){
print(number)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment