Checks if a string contains a given substring.
The string to search within.
The substring to search for.
Optional
true if search is found within str, otherwise false.
true
search
str
false
1.1.0
includes("Hello World", "World"); // trueincludes("Hello World", "world"); // false Copy
includes("Hello World", "World"); // trueincludes("Hello World", "world"); // false
Checks if a string contains a given substring.