Do you know what will be the output of this code?
JavaScript
function f(a, b = 2, c) {}
console.log(f.length);
Show answer and explanation
The answer is 1.
length is the number of parameters before the first one with a default (or a rest parameter). b has a default, so counting stops at a.