ECMAScript 6 introduced String.prototype.includes: const string = "foo"; const substring = "oo"; console.log(string.includes(substring)); // true