This is recursive, because the variational part of the template is reduced every call, for example, the call will recursively look like this:
print(1, 2, 3, 4, 5) // firstArg == 1 // ...args == 2,3,4,5 print(2, 3, 4, 5) // firstArg == 2 // ...args == 3,4,5 print(3, 4, 5) // firstArg == 3 // ...args == 4,5 print(4, 5) // firstArg == 4 // ...args == 5 print(5) // firstArg == 5 // ...args == {} print()
print() needed as a base case when the variable list is empty.
source share