I have a list of products and I want to copy the list of products by input parameter. so I used contains to scarching the input line in the product list. its working mode with a web page. but when I open the same page on a mobile web page, it does not work. and gives an error that "contains" does not determine.
if(productlist[i].name.toLowerCase().contains(input_val.toLowerCase())) --my business logic--
after that I tried with indexOf , then its working in both cases.
if(productlist[i].name.toLowerCase().indexOf(input_val.toLowerCase()) !== -1) --my business logic --
what's the problem for .contains?
source share