Files
30-seconds-of-code/snippets/isRegExp.md
2018-01-16 16:42:17 +02:00

240 B

isRegExp

Checks if value is classified as a RegExp object.

Use the instanceofoperator to check if the provided value is a RegExp object.

const isRegExp = val => val instanceof RegExp;
isRegExp(/./g); // true