This might be a duplicate but I had little success in finding the right answer. I’m trying to achieve something like this :
var joinArrays = function(myCollectionOfArguments) {
return array.concat(array1, array2, ..... , arrayN);
};
In which case myCollectionOfArguments will be array1, array2, ..... , arrayN. How could I achieve something like that ? I do know that if I had a callback function I cold pass as many arguments as I would like using .apply(), but in this certain case I’m a bit confused on the approach.
EDIT : So, to be more descriptive : Instead of passing just one argument, I would to be able to pass as many as I want without having to specify it when I define the function’s arguments, in my case myCollectionOfArguments, would be just one argument when defining the function, but when I want to use the function I want to be able to pass more than one argument ;
If I get your intention right, try: