JS Built-ins
StringString.prototype.includesintermediate

String.prototype.includes() β€” case-sensitive

πŸ“– 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() β€” Case Sensitivity

.includes() is case-sensitive.

Challenge: Implement includesIgnoreCase(str, sub) that checks for sub case-insensitively.

includesIgnoreCase('Hello World', 'hello') // β†’ true
πŸ’‘ Hints (1)
  • β€’ Convert both strings to lowercase before calling `.includes()`.