I am getting an error TypeError: Method RegExp.prototype.test called on incompatible receiver undefined
var err = {message : "Resume"};
const isResumeError = RegExp('Missing Parameter "Resume"').test;
if (isResumeError(err.message)) {
console.log("if");
}
else {
console.log("else");
}
console.log(isResumeError, "isResumeError");
test
method. – blhsingconst isResumeError = (regex = RegExp('Missing Parameter "Resume"')).test.bind(regex);
Basically the same as the linked answer if you read it. – blhsing