Skip to content

Instantly share code, notes, and snippets.

@Harinder
Created September 28, 2014 09:19
Show Gist options
  • Save Harinder/88af68577d1eb8e4bfc4 to your computer and use it in GitHub Desktop.
Save Harinder/88af68577d1eb8e4bfc4 to your computer and use it in GitHub Desktop.
Variadic function arguments
func sumOf(numbers: Int...) -> Int {
var sum = 0
for number in numbers {
sum += number
}
return sum
}
sumOf()
sumOf(42, 597, 12)”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment