Tell us what’s happening:
Your code so far
function telephoneCheck(str) {
// Good luck!
return true;
}
telephoneCheck("555-555-5555");
Link to the challenge:
I am doing this challenge right now, the thing I want to ask has nothing to do with logic or coding.
I am not from the US, could someone explain the US phone number format a little bit?
There are a few example that are given from the quest:
555-555-5555
(555)555-5555
(555) 555-5555
555 555 5555
5555555555
1 555 555 5555
So, my understanding is that there are a few requirements:
- 10 digit with numbers only
- if the user added 1 in front of the 10 digit it counts too.
So, the thing I need to get rid of from the user inputs are non-number letter. What about 2 555 555 5555, is this a valid number??