🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Telephone Number Validator - JavaScript - The freeCodeCamp Forum
May 29, 2023 - function telephoneCheck(str) { // A phone number must have 10 digits or 11 digits if the first number is a 1 for (let i = 0; i < str.length; i++) { if (str[i] > "0" && str[i] <= "9" && str.length() == 10 || str[i] >…
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Build a Telephone Number Validator Project - Build a Telephone Number Validator - JavaScript - The freeCodeCamp Forum
February 14, 2024 - I’ve one only problem, and with the following test: When the #user-input element contains 1 456 789 4444 and the #check-btn element is clicked, the #results-div element should contain the text Valid US number: 1 456 789 4444 .
Discussions

FCC Challenge: JS Algorithm: Telephone Number Validator
I learned a lot in this challenge. It’s important to account for the possible cases in the test phase instead of while coding. What I’m saying is that coding the solution is a different session from coming up with the test cases, this is the importance of QA Test Automation. More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
December 12, 2020
US Telephone Number Validator
Hello, I’ve been trying to validate US numbers for days now and would really appreciate your help . My code is bellow and I still have 3 more types of numbers to validate. telephoneCheck(“1 555)555-5555”) telephoneCh… More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
October 9, 2021
freeCodeCamp Challenge Guide: Telephone Number Validator - Guide - The freeCodeCamp Forum
Telephone Number Validator Hints/Solutions are not provided for certification projects as these are intended to be a test of your learning and understanding. More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
47
May 25, 2021
Regex Problem - Build a Telephone Number Validator
Hey everyone 👋 I’m working on the “Build a Telephone Number Validator” project in the JavaScript course, and I’m trying to build a regex to match all valid formattings of a U.S. phone number. As far as I understand, a US phone number is very precisely formatted as such (I omitted ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
1
0
August 28, 2024
🌐
CodePen
codepen.io › pie9 › pen › Rwwjdvd
FreeCodeCamp - JavaScript Projects - Telephone Number Validator
<h1>JavaScript Algorithms and Data Structures Projects: Telephone Number Validator</h1> <p>Return true if the passed string looks like a valid US phone number. The user may fill out the form field any way they choose as long as it has the format ...
🌐
freeCodeCamp
freecodecamp.org › news › a-walkthrough-of-the-freecodecamp-telephone-validator-project
A Walkthrough of the FreeCodeCamp Telephone Validator Project
October 2, 2019 - Last project was the Caesars Cipher, the third entry in our series. You can check it out here. Now we're doing the Telephone Validator. Our job is to determine whether a given phone number is a valid US number or not.
🌐
CodePen
codepen.io › Dr-Toboggan › pen › xmQrKr
FCC - Telephone Number Validator
If the country code is provided, you must confirm that the country code is 1. Return true if the string is a valid US phone number; otherwise return false.<br> View additional requirements here: <a href="https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator" target="_blank">FCC Telephone Validator</a>
🌐
DEV Community
dev.to › rthefounding › checking-if-telephone-number-is-valid-4iop
Validating Phone Numbers with JavaScript - DEV Community
September 2, 2021 - “Freecodecamp.org.” Edited by Quincy Larson, Telephone Number ValidatorPassed, Quincy Larson, 2014, www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator.
🌐
YouTube
youtube.com › watch
Build a Telephone Number Validator Project: Story 1-34 | freeCodeCamp | JavaScript | (Beta) - YouTube
🔗Course Link: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/build-a-telephone-number-validator-project/build-a-telephone-n...
Published   May 21, 2024
🌐
freeCodeCamp
forum.freecodecamp.org › contributors
FCC Challenge: JS Algorithm: Telephone Number Validator - Contributors - The freeCodeCamp Forum
December 12, 2020 - I learned a lot in this challenge. It’s important to account for the possible cases in the test phase instead of while coding. What I’m saying is that coding the solution is a different session from coming up with the te…
Find elsewhere
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
US Telephone Number Validator - JavaScript - The freeCodeCamp Forum
October 9, 2021 - My code is bellow and I still have 3 more types of numbers to validate. telephoneCheck(“1 555)555-5555”) telephoneCheck(“555)-555-5555”) telephoneCheck("(555-555-5555") those 3 must return false my code so far… function telephoneCheck(str) ...
🌐
freeCodeCamp
forum.freecodecamp.org › guide
freeCodeCamp Challenge Guide: Telephone Number Validator - Guide - The freeCodeCamp Forum
May 25, 2021 - Telephone Number Validator Hints/Solutions are not provided for certification projects as these are intended to be a test of your learning and understanding.
🌐
YouTube
youtube.com › watch
FreeCodeCamp Telephone Number Validator Project Tutorial & Walkthrough - YouTube
This is a tutorial of how to create the Telephone Number Validator Project for the FreeCodeCamp JavaScript Algorithms and Data Structures Certification. It w...
Published   May 4, 2024
🌐
GitHub
github.com › NnejiBen › Telephone-Number-Validator
GitHub - NnejiBen/Telephone-Number-Validator: FreeCodeCamp's JavaScript course project to build a telephone number validator.
FreeCodeCamp's JavaScript course project to build a telephone number validator. - NnejiBen/Telephone-Number-Validator
Author   NnejiBen
🌐
CodeSandbox
codesandbox.io › s › freecodecamp-telephone-number-validator-shyfe
freecodecamp - Telephone Number Validator - CodeSandbox
August 16, 2019 - freecodecamp - Telephone Number Validator by stevva
Published   Aug 16, 2019
Author   stevva
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Build a Telephone Number Validator - JavaScript - The freeCodeCamp Forum
February 23, 2024 - Hey so I finished writing my JS for the Telephone Validator project. Something weird happens and I can’t work out what’s going on… So for a few of the numbers the validation function returns true, but then I run it aga…
🌐
Rssing
freecodecamp62.rssing.com › chan-75901937 › index-page1.html
freeCodeCamp Challenge Guide: Telephone Number Validator
@j-schuster wrote: Not the best solution, but it works. Took a little bit longer approach reading up on sorting U.S phone numbers as opposed to using the six criteria given in the description.... View Article ... @RyzorBent wrote: also not the best but it works! function telephoneCheck(str) { // ...
🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Help with Telephone Number Validator - JavaScript - The freeCodeCamp Forum
December 12, 2018 - Hi everybody! I’ve been working on the Telephone Number Validator and I’ve gotten myself a bit stuck. My strategy was originally to just remove all standard formatting tools in phone numbers (parentheses, spaces, dashes) and then check that everything in the number was digits.
🌐
Reddit
reddit.com › r/freecodecamp › i almost managed to successfully trick the "telephone number validator" challenge by significantly reducing the regex string size
r/FreeCodeCamp on Reddit: I almost managed to successfully trick the "Telephone Number Validator" challenge by significantly reducing the regex string size
June 4, 2020 -
function telephoneCheck(str) {
var regex = /^(1 *)?(\d( |-)*){10}$/gm;
return regex.test(str);
}

It is a very short regex, which checks for a possible 1 at the beginning and checks for ten additional digits. Spaces and dashes are allowed. Only three cases out of thirty failed. I might be able to successfully trick every case eventually, but I am too tired from regex now at this point.

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/telephone-number-validator

🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Build a Telephone Number Validator Project - JavaScript - The freeCodeCamp Forum
March 14, 2024 - I am working on my telephone number validator project and i could use some help. I need text to display if the phone is valid or not i thought about using an if and else statment but im not sure how to go about that. The part im stuck on is if return statment is true than display valid us phone numbe thanks const userInput = document.getElementById("user-input"); const checkBtn = document.getElementById("check-btn"); const clearBtn = document.getElementById("clear-btn"); const results = docu...