js contains function code example
Example 1: js string contains
'Bandeira do Brasil'.includes('brasil'); // retorna false
Example 2: js string contains
var string = "foo";
var substring = "oo";
console.log(string.indexOf(substring) !== -1);
'Bandeira do Brasil'.includes('brasil'); // retorna false
var string = "foo";
var substring = "oo";
console.log(string.indexOf(substring) !== -1);