Function isRegExp

  • Checks if value is classified as a RegExp object.

    Parameters

    • value: any

      The value to check.

    Returns value is RegExp

    Returns true if value is a regexp, else false.

    5.5.0

    isRegExp(/abc/)
    // => true

    isRegExp('/abc/')
    // => false