Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The first two checks turn into two `case`. The third check is split into two cases:
Primele două verificări sunt transformate în două blocuri `case`. Al treilea test este împărțit în două cazuri:

```js run
let a = +prompt('a?', '');
Expand All @@ -21,6 +21,6 @@ switch (a) {
}
```

Please note: the `break` at the bottom is not required. But we put it to make the code future-proof.
Observație: instrucțiunea `break` de la sfârșit nu este necesară, dar putem să o adăugăm pentru a pregăti codul pentru viitor.

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.
Copy link
Member

@lighthousand lighthousand Jun 4, 2019

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...."