- Source:
Methods
(static) isRegExp(value) → {boolean}
Returns whether the given value is a regexp, regardless of which context it
comes from.
The context may be another frame.
This is the proper idiomatic way to test whether an object is a regexp and
replaces the less generally useful `instanceof` check (which does not work
across contexts) and the strangeness that the `typeof` a regexp is
`"object"`.
Parameters:
Name | Type | Description |
---|---|---|
value |
any value |
- Source:
Returns:
whether the given value is a regexp
- Type
- boolean