Skip to content

isRegExp

Checks if the given value is a RegExp. Instances from [other realms][1] are also supported. [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms

Usage

isRegExp(/abc/); // => true
isRegExp("abc"); // => false

Installation

Terminal window
npx atmx add helper is-reg-exp