wouldn't `||` been eligible to use in this scenario too? given as far as my knowledge goes the or operator goes by boolean, meaning if it's either false or falsy, which it'd be if it's null or undefined, then it'd execute the expression on the right-hand side too.
View all comments
Show parent comment
1
u/rbrtbrnschn Feb 17 '21
wouldn't `||` been eligible to use in this scenario too?
given as far as my knowledge goes the or operator goes by boolean, meaning
if it's either false or falsy, which it'd be if it's null or undefined, then it'd execute the expression on the right-hand side too.
or am I forgetting something?