In any case, we can deal with falsity values ββin || operators that are lazily evaluated?
So, for example, if we have:
function isOldEnough(age) { age = age || 18; return age; } isOldEnough(0)
In ES6, you can just declare it as
function isOldEnough(age = 18) { ... }
Is there anything we can do in ES5 to avoid this problem?
source share