.includes() alternative

Matan Zohar's icon

I'm trying to test if a substring is part of a string in a js object. I noticed .includes() doesn't work, the RegEx alternative doesn't work, nor does the indexOf alternative.

Any solutions with js to this basic problem? Or am I gonna have to use node?

Matan Zohar's icon

nevermind the solution is RegEx:

var isMatch = new RegExp(substring, "i").test(string);