This commit is contained in:
Ilya Kantor 2019-07-29 17:01:05 +03:00
parent f22874e6b2
commit 19c782ff3d
2 changed files with 7 additions and 6 deletions

View file

@ -4,14 +4,14 @@ For given strings though, a simple `'=='` works too.
```js no-beautify
if(browser == 'Edge') {
alert("У вас браузер Edge!");
alert("You've got the Edge!");
} else if (browser == 'Chrome'
|| browser == 'Firefox'
|| browser == 'Safari'
|| browser == 'Opera') {
alert( 'Мы поддерживаем и эти браузерыo' );
alert( 'Okay we support these browsers too' );
} else {
alert( 'Надеемся, что эта страница выглядит хорошо!' );
alert( 'We hope that this page looks ok!' );
}
```

View file

@ -9,17 +9,18 @@ Write the code using `if..else` which would correspond to the following `switch`
```js
switch (browser) {
case 'Edge':
alert( "У вас браузер Edge!" );
alert( "You've got the Edge!" );
break;
case 'Chrome':
case 'Firefox':
case 'Safari':
case 'Opera':
alert( 'Мы поддерживаем и эти браузеры' );
alert( 'Okay we support these browsers too' );
break;
default:
alert( 'Надеемся, что эта страница выглядит хорошо!' );
alert( 'We hope that this page looks ok!' );
}
```