JS Built-ins
RegExptestbeginner

RegExp test() β€” case insensitive

πŸ“– Usage Example
const re = /\d+/
re.test('abc123') // β†’ true
re.test('abc')    // β†’ false

Use RegExp.test() to check whether a string matches the regular expression pattern.

RegExp.prototype.test()

With the i flag, test() ignores case.

Challenge: Verify that /hello/i.test('HELLO') returns true.

πŸ’‘ Hints (1)
  • β€’ The i flag enables case-insensitive matching