Skip to content

Commit b46004c

Browse files
authored
Merge pull request #88 from rajcespedes/patch-3
Update solution.md
2 parents f4b6197 + a6f7c72 commit b46004c

File tree

1 file changed

+12
-12
lines changed
  • 1-js/02-first-steps/13-switch/1-rewrite-switch-if-else

1 file changed

+12
-12
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
To precisely match the functionality of `switch`, the `if` must use a strict comparison `'==='`.
1+
Para que la funcionalidad de `switch` coincida precisamente, el `if` debe utilizar una comparación estricta `'==='`.
22

3-
For given strings though, a simple `'=='` works too.
3+
Para strings, un simple `'=='` también funciona.
44

55
```js no-beautify
6-
if(browser == 'Edge') {
7-
alert("You've got the Edge!");
8-
} else if (browser == 'Chrome'
9-
|| browser == 'Firefox'
10-
|| browser == 'Safari'
11-
|| browser == 'Opera') {
12-
alert( 'Okay we support these browsers too' );
6+
if(navegador == 'Edge') {
7+
alert("¡Tienes Edge!");
8+
} else if (navegador == 'Chrome')
9+
|| navegador == 'Firefox'
10+
|| navegador == 'Safari'
11+
|| navegador == 'Opera') {
12+
alert( 'Está bien, soportamos estos navegadores también' );
1313
} else {
14-
alert( 'We hope that this page looks ok!' );
14+
alert( '¡Esperamos que la página se vea bien!' );
1515
}
1616
```
1717

18-
Please note: the construct `browser == 'Chrome' || browser == 'Firefox' …` is split into multiple lines for better readability.
18+
Nota: El constructor `navegador == 'Chrome' || navegador == 'Firefox' …` es separado en múltiples líneas para mejor lectura.
1919

20-
But the `switch` construct is still cleaner and more descriptive.
20+
Pero el constructor de `switch` sigue siendo más fácil de leer y más descriptivo.

0 commit comments

Comments
 (0)