You're viewing a single thread.
View all comments
125
comments
I'd take a
not
or "if not" operator tbh.26 0 ReplyIt has a not keyword it's used for pattern matching.
if (x is not null)
9 0 ReplyIt also has a
!=
.3 0 ReplyPattern matching is different.
2 0 ReplyYeah, I just said it since you used it with null. I used it a lot for enums
2 0 ReplyThe type matching is the most common thing I use it with. Combined with inline variables.
if (x is string { Length: 5} s) { // do stuff with s }
And switch expressions.
As a side note inline variables are amazing haha
1 0 Reply
Stuff can be two things
2 0 Reply
ifnt instead of ifn't
3 0 Reply
You've viewed 125 comments.
Scroll to top