I’m still having some trouble with this one. Could someone help?
function telephoneCheck(str) {
// Good luck!
var re = /^[1]?\s?[[(]\d{3}[)]|\d{3}][-\s]\d{3}[-\s]\d{4}$/g;
console.log(str.search(re)!==-1);
if(str.search(re)!==-1){
return true;
}else{
return false;
}
}
telephoneCheck("555-555-5555");