function isRegExp(value) {
return Object.prototype.toString.call(value) === '[object RegExp]'
}
var val=/\d|X|x/
var res = isRegExp(val);
console.log((res))//true
JS - 判断数据是不是正则对象
最新推荐文章于 2024-07-03 19:55:00 发布
function isRegExp(value) {
return Object.prototype.toString.call(value) === '[object RegExp]'
}
var val=/\d|X|x/
var res = isRegExp(val);
console.log((res))//true