How to check whether a string contains a substring in JavaScript?
ECMAScript 6 introduced String.prototype.includes: Expand snippet includes doesn’t have Internet Explorer support, though. In ECMAScript 5 or older environments, use String.prototype.indexOf, which returns -1 when a substring cannot be found: