You can use the includes() method, introduced in ECMAScript 6 (ES6).
Using includes():
This method returns true if the substring is found within the string and false otherwise.
const mainString = 'Hello, Edureka!';
const subi = 'Edureka';
console.log(mainString.includes(subi)); // Output: true
In this example, mainString.includes(subi) evaluates to true because 'Edureka' is a substring of 'Hello, Edureka!'. It's important to note that includes() is case-sensitive.