You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the suggested feature
Currently x ?? 0 is a syntax error. It would be handy if this meant the nullish coalescing operator denoted by ?? in JavaScript. For example, one could then do object lookup with a fallback : {foo: 7, bar: 3}["baz"] ?? 0.
Current workaround nullish(x, y) = (x == null or x == undefined) ? y : x; nullish(null, 0)
I am not aware of a short way to test for null or undefined unlike x == null in JavaScript which is true if x is either null or undefined; in mathjs expression language it is true when x is null and false when x is undefined.
The text was updated successfully, but these errors were encountered:
Describe the suggested feature
Currently
x ?? 0
is a syntax error. It would be handy if this meant the nullish coalescing operator denoted by??
in JavaScript. For example, one could then do object lookup with a fallback :{foo: 7, bar: 3}["baz"] ?? 0
.Current workaround
nullish(x, y) = (x == null or x == undefined) ? y : x; nullish(null, 0)
I am not aware of a short way to test for null or undefined unlike
x == null
in JavaScript which is true if x is either null or undefined; in mathjs expression language it is true when x is null and false when x is undefined.The text was updated successfully, but these errors were encountered: