Help in understanding spread syntax console.log

In the function shown below I do understand what is going on with the syntax and the function. My confusion is in the second console.log. Can someone explain what is going on with (“string”, null, [1, 2, 3], {})) ?

function howMany(…args) {
return “You have passed " + args.length + " arguments.”;
}
console.log(howMany(0, 1, 2)); // You have passed 3 arguments.
console.log(howMany(“string”, null, [1, 2, 3], {})); // You have passed 4 arguments.

second console log arguments just like the first ones but have different types, like string, null, array, object.

Thank you I can see that and thanks for the reply. If I understand this correctly its just filler. Does not matter on what was entered (sort of) it is simply pulling the data type. If I delete null for example it will return 3 arguments.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.