Hello, i can’t find any solution… My reflection:
- remove ‘-’ and find if it’s number and length === 10.
for other, make a pattern and check if they match with it.
I’m block and i need little help to grow my reflection…
**Your code so far**
function telephoneCheck(str) {
str = str.replace(/[^\d]/g, "");
if(str.length === 10){
return true
}
}
telephoneCheck("555-555-5555");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Telephone Number Validator
Link to the challenge: