Browser support for array.includes and alternatives Browser support for array.includes and alternatives arrays arrays

Browser support for array.includes and alternatives


Instead of using an API that is currently marked as "experimental" consider using a more broadly supported method, such as Array.prototype.indexOf() (which is also supported by IE).

Instead of t.title.includes(string) you could use t.title.indexOf(string) >= 0

You can also use Array.prototype.filter() to get a new array of strings that meet a certain criteria, as in the example below.