Code Lab

Modo entrevista. Temporizador de 3 min, sin pistas y sin autocompletado

Spam check

FácilStrings3 min

Write a function checkSpam(text) that returns true if the string contains free money or xxx, and false if not. Letter case does not matter.

Ejemplos

checkSpam('Get FREE money now')

Devuelve true

checkSpam('xXx files')

Devuelve true

A match at the very start of the string counts too.
checkSpam('Release notes')

Devuelve false

Fuente

Cargando el editor…
  1. EntradacheckSpam('Get FREE money now')
    Esperadotrue
  2. EntradacheckSpam('xXx files')
    Esperadotrue
  3. EntradacheckSpam('Release notes')
    Esperadofalse

Las pruebas ocultas se ejecutan al enviar