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
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
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