没有人知道为什么我总是在执行JS方法时在Firefox控制台中得到“TypeError:str.match(...)为null”?总是得到“TypeError:str.match(...)为null”
function checkBreakPoints() {
var str = '@media only screen and (max-width:2em)';
var patt1 ="/@media[A-z, 0-9, \-,: , .,), (]*width:/gi";
console.log(str.match(patt1).length);
}
感谢您的帮助
字符类不是用逗号分隔的...... –
此外,'patt1'不应该在引号中。 – Andy