Tell us what’s happening:
Hi! I don’t understand why this switch statement is not working. What’s my error here? Thanks!
Your code so far
function telephoneCheck(str) {
let digits = str.replace(/\D/g, "");
switch (digits){
case digits.length < 10:
false
break;
}
};
telephoneCheck("123**&!!asdf#"); // returns undefined
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
.
Challenge: Telephone Number Validator
Link to the challenge: