use this :
function consoleAll(...args) {
console.log(...args)
}
consoleAll("hello", 2, {name : "milad"})
/*output -> "hello", 2, {
name: "milad"
}
*/
It's pretty simple but it depends on how you want to use this data you feel? But I suppose you could run an array length and sort your checks some how.
function MyHugeFunction (data) {
console.log(`Size: ${data.length}`);
console.log(`First Arg: ${data[0]}`);
console.log(`Entire Argument Set: ${data}`);
};
MyHugeFunction(["test","hello","123"]);
It's not obvious without the context but I think it is an exercise on spread operator.
In this case, your function would be something like
function(...args) {
args.forEach((val) => console.log(val))
}
or
function(...args) {
console.log(...args)
}
The "...args" is used to get all the arguments of your function in a "args array" and the forEach function applied to this array does the trick