Replies: 2 comments 3 replies
-
It is asserting if the value is there or not in the map. |
Beta Was this translation helpful? Give feedback.
3 replies
-
It can be seen as rusts A simple example of an if let assignment for an optional value. let number = Some(7);
if let Some(i) = number {
println!("Matched {i}!");
} instead of let number = Some(7);
if number.is_some() {
println!("Matched {}!", number.unwrap());
} V's way is easier to grasp I think. It's concise flow control to make use of values that might be optional or errors or to make sure that values of map keys or array indices are existent. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Who can tell me what the condition of this if statement is?
Is it
true == (v: = m ['abc'])
? or something elseI am confused.
Beta Was this translation helpful? Give feedback.
All reactions