I looked it up and found this regarding finding a substring in a larger string in an array. Array.Prototype.includes
if (t.title.includes(searchString))
My t
is part of a $.each
that's iterating through a larger array of objects (each objects got a buttload of info, from strings, dates and such). searchString
is whatever the user typed in a box. All this is a simple search function for a list I have on the page.
This works just fine in Chrome. But Firefox and IE are turning up errors stating
TypeError: currentTicket.title.includes is not a function
So I either put up a warning sign that my app only works on Chrome or I handcraft a find function? Weird thing is the doc page from MDN I posted states that only Firefox supports the array.includes
, strangely enough it's only Chrome that runs it.