-
@lorenschmidt its not concatenation, but argument passing. foo(...a) compiles to the equivalent of foo(a[0], a[1], a[2], a[3], ...) for every index of a. console.log is variadic and accepts/logs an arbitrary number of arguments. console.log(...ia) is the same as console.log('a', 'b', 'c', 'd')
-
@lorenschmidt spread_test(...ia) is also the same as spread_test(ia[0], ia[1], ia[2], ia[3]) or spread_test('a', 'b', 'c', 'd') but it only takes one argument, so 'a' is bound to input and the rest are dropped.