I can’t pass two of the requirements because of the length. where do i place this {3}
:
Your code so far
function telephoneCheck(str) {
// Good luck!
let regex = /^(1\s?)?(\(\d+\)|\d+)(\s|\-)?[\d+]{3}(\s|\-)?[\d+]{4}$/
if(str.match(regex)) {
return true;
}
return false;
}
console.log(telephoneCheck("555-555-5555"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator/