EN
JavaScript - String includes() method example
0
points
// ONLINE-RUNNER:browser;
const text = 'ABCDE';
console.log(text.includes('A')); // true
console.log(text.includes('X')); // false
console.log(text.includes('B')); // true
console.log(text.includes('B', 2)); // false
console.log(text.includes('ABC')); // true
console.log(text.includes('XYZ')); // false
1. Documentation
Syntax |
|
Parameters |
|
Result | The method returns true if the searchString is found anywhere within the given string, otherwise returns false . |
Description | This method lets you determine whether or not a string includes another string. |