Open JoshWillik opened 9 years ago
||
doesn't work anymore because of http://spiderlang.org/#code-safety-logical-operators-consistency
Additionally, the ??
operator checks only for undefined
or null
, and not all falsy values (0, false, etc).
About ??=
- definitely.
Am I correct in understanding that ?? based off of the c# ?? Either way the idea of ??= is a must
@M-Zuber Yes
I have a couple of points about the null coalescing operator,
??
.Firstly, why isn't it still
||
like vanilla JS and the rest of the programming languages[1]? Changing it just for the sake of change just introduces confusion is not an improvement, IMHO.Secondly, the ruby-esque
||=
operator would be amazing.becomes
(this can be
??=
if you're quite set on keeping the??
)[1] Except the unruly PHP