0

Include checks the string exist or not, it returns true or false.

keep in mind that the matching is done by includes() is case-sensitive

var name = "Workingcode";
gs.print(name.includes('wor')); // false, because first letter is in small caps
gs.print(name.includes('Wor')); // true, as expected

Output:

Use of includes() instead of indexOf() in ServiceNow and JavaScript
Working Code Asked question July 20, 2023