DEV Community

Cover image for Phone Number Formatter JavaScript

Phone Number Formatter JavaScript

Hello Dev World Blog on January 05, 2021

Day 4 of 365 Days of Coding challenge! link to the video Disclaimer: there are MANY ways to solve this problem this is an answers that I would s...
Collapse
 
jamesthomson profile image
James Thomson

Using replace with capturing groups to format the numberπŸ‘Œ

Collapse
 
codefinity profile image
Manav Misra

Looks πŸ‘€ good!

If desired, can drop all of those else to shorten it up as the 'early returns' in the ifs will exit the fxn. any way.

Collapse
 
primadev2 profile image
Primadev

Bookmark