Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function task6() {
- function checkSpam(str) {
- str = str.toLowerCase();
- return !!(~str.indexOf('spam') || ~str.indexOf('sex'));
- }
- console.log(checkSpam('get new Sex videos')); //true
- console.log(checkSpam('[SPAM] How to earn fast money?')); //true
- console.log(checkSpam('New PSD template')); //false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement