Tell us what’s happening:
what exactly the \
operator does in regular expression? coz when m using (\(\d{3}\)|\d{3})
then its passing all the tests…
Your code so far
var regex=/^(1\s?)?((\d{3})|\d{3})(-|\s)?\d{3}(-|\s)?\d{4}$/;
return regex.test(str);
}
telephoneCheck("555-555-5555");```