JS Built-ins
StringString.prototype.includesbeginner

String.prototype.includes() β€” not found

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

Challenge: Implement lacksDigit(str) that returns true when str does NOT include any digit. Use .includes() for a single digit check.

For simplicity, check for the digit '5'.

lacksDigit('hello') // β†’ true
lacksDigit('h5llo') // β†’ false
πŸ’‘ Hints (1)
  • β€’ Negate the result with `!` to check for absence.