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

5 lines
135 B
JavaScript

function checkSpam(str) {
var lowerStr = str.toLowerCase();
return !!(~lowerStr.indexOf('viagra') || ~lowerStr.indexOf('xxx'));
}