Accueil / javascript / 1-js / 05-data-types / 03-string / 2-check-spam / task.md

task.md

importance: 5

---

Vérifier le spam

Écrire une fonction checkSpam(str) qui retourne true si str contient 'viagra' ou 'XXX', sinon false.

La fonction doit être sensible à la casse :

checkSpam('buy ViAgRA now') == true
checkSpam('free xxxxx') == true
checkSpam("innocent rabbit") == false