-
Notifications
You must be signed in to change notification settings - Fork 31
The "switch" statement #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "switch" statement #9
Conversation
break; | ||
|
||
*!* | ||
case 3: // (*) grouped two cases | ||
case 3: // (*) douș cazuri grupate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo : "douș"
Possible fix : "două"
|
||
The ability to "group" cases is a side-effect of how `switch/case` works without `break`. Here the execution of `case 3` starts from the line `(*)` and goes through `case 5`, because there's no `break`. | ||
Posibilitatea de a ȚgrupaȚ cazuri este un efect secundar al modului în care funcționează `switch/case` fără `break`. Execuția blocului `case 3` începe de la linia marcată `(*)` și continuă în `case 5`, pentru că nu există niciun `break`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo : "...de a ȚgrupaȚ..."
Possible fix : '...de a"grupa"...'
@@ -1,20 +1,20 @@ | |||
To precisely match the functionality of `switch`, the `if` must use a strict comparison `'==='`. | |||
Pentru a obține exact funcționalitatea instrucțiunii `switch`, `if` trebuie să folosească operatorul de egalitate exactă `'==='`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technical typo : "...egalitate exactă"
Possible fix : "...egalitate strictă"
|
||
In the future, there is a chance that we'd want to add one more `case`, for example `case 4`. And if we forget to add a break before it, at the end of `case 3`, there will be an error. So that's a kind of self-insurance. | ||
În viitor este posibil că vom dori să mai adăugăm încă un `case`, de exemplu `case 4`. Dacă uităm să adăugăm un `break` înaintea lui, la sfârșitul blocului `case 3`, vom obține o eroare. Deci avem un fel de auto-asigurare. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional suggestion for grammar :
if can be done transform this : "...este posibil că vom dori...."
into this : "...este posibil să dorim...."
"...este posibil să vrem...."
Please make the requested changes. After it, add a comment "/done". |
/done |
No description provided.