en.javascript.info/01-js/02-first-steps/12-ifelse/06-rewrite-if-else-question/task.md
Ilya Kantor f301cb744d init
2014-10-26 22:10:13 +03:00

22 lines
517 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Перепишите 'if..else' в '?'
[importance 5]
Перепишите `if..else` с использованием нескольких операторов `'?'`.
Для читаемости -- оформляйте код в несколько строк.
```js
var message;
if (login == 'Вася') {
message = 'Привет';
} else if (login == 'Директор') {
message = 'Здравствуйте';
} else if (login == '') {
message = 'Нет логина';
} else {
message = '';
}
```