en.javascript.info/1-js/4-data-structures/3-string/2-check-spam/task.md
2015-01-11 01:54:57 +03:00

14 lines
436 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.

# Проверьте спам
[importance 5]
Напишите функцию `checkSpam(str)`, которая возвращает `true`, если строка `str` содержит 'viagra' or 'XXX', а иначе `false`.
Функция должна быть нечувствительна к регистру:
```js
checkSpam('buy ViAgRA now') == true
checkSpam('free xxxxx') == true
checkSpam("innocent rabbit") == false
```