2 ms·
It's a switch statement that's an expression. That's a nice ergonomic improvement when you want to assign the result to a variable. Especially as it allows you
by nicoburns 6y ago
It's a switch statement that's an expression. That's a nice ergonomic improvement when you want to assign the result to a variable. Especially as it allows you to use a non-mutable variable whereas otherwise you'd have to make it mutable.
- chmod775 6y agoI wouldn't compare it to a switch statement, because a switch statement - even though it looks similar - has fundamentally different control flow.
- deleted 6y ago[deleted]