Comment
Comment by cookiengineer
Technically you could just use an assignment ternary expression for this:
I used this kind of style for argument initialization when I was writing JS code, right at the top of my function bodies, due to ES not being able to specify real nullable default values. (and I'm setting apart why I think undefined as a value is pointless legacy).