How to check string contains in another string in es6
we can use contains(), indexOf() method to check if one String contains another String in JavaScript/es6
const string = "JavaScript"; const substring = "Java"; const result = string.includes(substring));const results = string.indexOf(substr) !== -1;
Comments