Búsqueda de cadenas JS
var str = "This is a test sentence";
var hasTest = str.includes("test");
if(hasTest == true){
//do a thing
}
Lazy Lemur
var str = "This is a test sentence";
var hasTest = str.includes("test");
if(hasTest == true){
//do a thing
}
let str = "Please locate where 'locate' occurs!";
str.search("locate");
"I love cats".indexOf("cat") //returns 7, the position of "cat"