6__Create_Phone_Number.js 213 B

1234567
  1. function createPhoneNumber(numbers = []) {
  2. let str = "(";
  3. str += numbers.slice(0, 3).join("") + ") ";
  4. str += numbers.slice(3, 6).join("") + "-";
  5. str += numbers.slice(6).join("");
  6. return str;
  7. }