en.javascript.info/1-js/4-data-structures/3-string/2-check-spam/task.md
Ilya Kantor 2b874a73be ok
2016-03-09 00:16:22 +03:00

16 lines
305 B
Markdown

importance: 5
---
# Check for spam
Write a function `checkSpam(str)` that returns `true` if `str` contains 'viagra' or 'XXX', otherwise `false.
The function must be case-insensitive:
```js
checkSpam('buy ViAgRA now') == true
checkSpam('free xxxxx') == true
checkSpam("innocent rabbit") == false
```