en.javascript.info/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md
Ilya Kantor 9ad9063d00 up
2016-11-28 21:35:42 +03:00

26 lines
427 B
Markdown

importance: 5
---
# Rewrite the "switch" into an "if"
Write the code using `if..else` which would correspond to the following `switch`:
```js
switch (browser) {
case 'Edge':
alert( "You've got the Edge!" );
break;
case 'Chrome':
case 'Firefox':
case 'Safari':
case 'Opera':
alert( 'Okay we support these browsers too' );
break;
default:
alert( 'We hope that this page looks ok!' );
}
```