GitHub 6248★

Check if a value is a regular expression

JavaScript version

const isRegExp = (value) => Object.prototype.toString.call(value) === '[object RegExp]';

TypeScript version

const isRegExp = (value: any): boolean => Object.prototype.toString.call(value) === '[object RegExp]';
Follow me on and to get more useful contents.