12 and 15 is well-known to be quite dangerous, that is why rather than
let c = a || b // All falsy value is short circuited.
This is safer
let c = a ?? b // Does not short circuit '', 0, NaN; only null and undefined
Without ??, I do have to write my own utility function sometimes.
??
Thanks
We're a place where coders share, stay up-to-date and grow their careers.
12 and 15 is well-known to be quite dangerous, that is why rather than
This is safer
Without
??, I do have to write my own utility function sometimes.Thanks