New syntax: null-aware operators
sethladd opened this issue · 0 comments
sethladd commented
Hi!
New syntax is coming in 1.12. Here's some samples:
print(exp ?? other); // prints other if exp is null
obj ??= 'hi'; // sets obj to hi if obj is null
obj?.method(); // calls method if obj is not null
The 1.12-dev SDK supports this now, if you want to try it out.
Hope that helps!