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.