190
rated 0 times
[
193]
[
3]
/ answers: 1 / hits: 38231
/ 9 Years ago, mon, january 4, 2016, 12:00:00
I'm wallowing in ES2015+ luxury with a few projects right now and am wondering whether I can get rid of the much hated crutch to check for undefined
in the new wonderland.
Is there a shorter but still exact way to typeof varName === 'undefined'
in ES2015+ already?
Of course I could use default parameters but this also feels like an unnecessary assignment.
function coolFn(a = null){
if (a===null) console.log(no a supplied);
}
More From » ecmascript-6