That's because default params in JS are essentially syntactic sugar ex -
function example(a = 1) {
...
}
behaves the same as function example(a) {
a = (typeof a !== 'undefined') ? a : 1
...
}