contains

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

La función contains determina si la primera cadena del argumento contiene la segunda cadena del argumento y devuelve el booleano verdadero o falso.

Sintaxis

contains( haystack , needle )

Argumentos

haystack

La cadena donde buscar

needle

La subcadena a buscar en haystack

Devuelve

true si haystack contiene needle. Si no, false.

Definido

Soporte en Gecko

Soportado.