JavaScript Algorithms and Data Structures Projects - Telephone Number Validator

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
let telephoneCheck = false;
let hasCorrectParentheses = false;

function telephoneCheck(str) {
const tenDigitRegex = /\d{10}/;
const elevenDigitRegex = /\d{11}/;
const startWithOneRegex = /^(1){1}/;
const permittedCharsRegex = /[0-9\-\(\) ]/;
const correctParenthesesRegex = /(\([0-9]{3}\))*/;

let hasTenDigits = tenDigitRegex.test(str);
let hasElevenDigits = elevenDigitRegex.test(str);
let startsWithOne = startWithOneRegex.test(str);
let hasPermittedCharsOnly = false;
let hasCorrectParentheses = false;


}
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: JavaScript Algorithms and Data Structures Projects - Telephone Number Validator

Link to the challenge:

hey there, what questions do you have for this project?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.