Function isRegExp

Determines if a value is a RegExp.

isRegExp(/abc/); // true
isRegExp(new RegExp('abc')); // true
isRegExp('abc'); // false
  • Parameters

    • x: unknown

      The value to check.

    Returns x is RegExp

    A boolean indicating whether the value is a RegExp.