JS Built-ins
StringString.prototype.includesintermediate

String.prototype.includes() β€” with position parameter

πŸ“– Usage Example
const str = 'Hello, World!'
str.includes('World')    // β†’ true
str.includes('xyz')      // β†’ false
str.includes('Hello', 1) // β†’ false

Use includes() to check if a string contains a specific substring, with an optional start position.

String.prototype.includes() β€” Start Position

The optional second argument position sets where the search starts.

'hello hello'.includes('hello', 1) // β†’ true (found at index 6)
'hello hello'.includes('hello', 7) // β†’ false

Challenge: Implement includesAfter(str, sub, pos).

πŸ’‘ Hints (1)
  • β€’ `str.includes(search, position)` starts searching from `position`.