angular string contains

JavaScript
var string = "foo";
var substring = "oo";

console.log(string.indexOf(substring) !== -1);const string = "foo";
const substring = "oo";

console.log(string.includes(substring));
Source

Also in JavaScript: