I was looking for a good time but all the questions were different from mine.
I'm trying to find a string in an array where the strings within the array contain more than one word, for example:
var array = ["hola soy un string", " asd hola asd " , "hola"]
if I do:
array.indexOf("hola")
I will return 2, okay.
But, if my array is like this:
var array = ["hola asd", "asdasd hola", "aaxs hola asdxas"]
array.indexOf("hola");
does not return anything despite the fact that "hello" is, why is this?
Also try this way:
array.map(function(i) { return i; }).indexOf("hola");
But more of the same, it did not work.