Usually I would expect a
String.contains() method, but there doesn't seem to be one.
What is a reasonable way to check for this?
ECMAScript 6 introduced
const string = "foo"; const substring = "oo"; console.log(string.includes(substring));
var string = "foo"; var substring = "oo"; console.log(string.indexOf(substring) !== -1);