Is it possible to create an infinite array (in javascript) and give it to a function?

advertisements

I was wondering if it would be possible to create an array infinitely long, so that any number I would put in my function : for exemple : function arr(2,3,4,5,6,7), would be treated as an array and put in a "table", but it didn't mather how many number I put in, the table would just extend! Is there a command I can call that creates such an array?


In JavaScript, inside any function there is a variable available called arguments. You can treat it like an array, and enumerate the arguments passed into the function, no matter how many there are.