findErr method should return true if any of the text value in condition found in the string it throws error i added. What would be correct approach to cover all casing scenario ?
const str = "Not Covered Invalid Quantity invalid quantity Invalid quantityfor the product"
const findErrCode = ((item) =>
  item.match(/(Not Covered|Invalid Quantity|invalid quanity|Invalid quantity)/)
);
console.log(findErrCode(str));Error
  TypeError: Cannot read property 'match' of undefined
        at findErrCode:43:30
        at eval:46:13
        at eval
        at new Promise
 
     
    