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.
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.