How to turn an array into a phone number

Asked

Viewed 21 times

-1

I’m in doubt how to write this function. could help me?

write a function that accepts an array of integers (from 0 to 9), which returns a string of these numbers in the format of a telephone ("(XX) XXXX-XXXX" or "(XX) XXXXX-XXXX").

  • If it is not a valid phone, return an empty string.
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.