Comment on ifn't
It also has a !=.
!=
Pattern matching is different.
Yeah, I just said it since you used it with null. I used it a lot for enums
The type matching is the most common thing I use or with. Combined with inline variables.
if (x is string { Length: 5} s) { // do stuff with s }
And switch expressions.
Lmaydev@programming.dev 9 months ago
Pattern matching is different.
olafurp@lemmy.world 9 months ago
Yeah, I just said it since you used it with null. I used it a lot for enums
Lmaydev@programming.dev 9 months ago
The type matching is the most common thing I use or with. Combined with inline variables.
And switch expressions.