Question: In Chrome, when I type `console.log` in the one below:

```
console.log("A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter");

```

...it prints it correctly, with no errors or warnings. I appended more parameters, but it still prints it out correctly.

```
console.log("A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter", "A parameter");

```

How can I have an "infinite" parameter function just like that one?

Answer: 
The modern way of doing this is using [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters):

```js
function printArguments(...args) {
  args.forEach((arg, index) => {
    console.log(`Argument ${index}:`, arg);
  });
}

printArguments('hello', true, new Date());

```

By using the `...args` syntax, all parameters are saved in an array named `args`.

Except of Internet Explorer, all browsers already ship this feature in their newest version.

Fiddle: <https://jsfiddle.net/Lbf0stst/>
You can use the arguments array: [jsfiddle.net/kUnJ2/](http://jsfiddle.net/kUnJ2/)

```
function foo() {
    for (var i = 0; i < arguments.length; i++) {
        document.body.innerHTML += arguments[i];
    }
}

foo("There ", "are ", "as ", "much ", "arguments ", "as ", "you ", "want.");

```