Anonymous user
Call a function: Difference between revisions
m
minor edit to formatting of Scala section
(Filling out Scala section) |
m (minor edit to formatting of Scala section) |
||
Line 1,983:
def allParamsOptional(firstOpt: Int = 42, secondOpt: String = "foobar") = ???
allParamsOptional() // function with all optional args
/
def sum[Int](values: Int*) = values.foldLeft(0)((a, b) => a + b)
|