var string = “foo”,
substring = “foo”;
console.log(string.indexOf(substring) !== -1);
and when you run the code result is True.
Hope you can easily check by using above code.