function checkPhone() { var phone = 18819164275 if (!(/^1[34578]\d{9}$/.test(phone))) { alert("手机号码有误,请重填"); return false; } else { console.log('JAJAJ') } } checkPhone()
输出的是JAJAJ