But what if you want to pass in a variable number of arguments, or want to capture multiple arguments into a single parameter? Placing an asterisk before the name of the parameter after the ``normal'' parameters does just that.
?def varargs(arg1, *rest) "Got #{arg1} and #{rest.join(', ')}"endvarargs("one") » "Got one and "varargs("one", "two") » "Got one and two"varargs "one", "two", "three" » "Got one and two, three"