Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    funny... built a solution that improves on this solution, then I read thesse comments lol... Solution below.

    /*

    • DISCLAIMER: This solution is an improvement upon @mdumic 's

    • (Current leading solution in the "Best-Practices" category).

    • This solution utilizes ES6's Template Literal & does not mutate the input Array.
      */

    function createPhoneNumber(numbers){
    let newNums = numbers.join('');
    return (${newNums.substring(0, 3)})
    + ' ' + newNums.substring(3, 6)
    + '-' + newNums.substring(6);
    };

  • Custom User Avatar

    funny... built a solution that improves on this solution, then I read thesse comments lol... Solution below.

    /*

    • DISCLAIMER: This solution is an improvement upon @mdumic 's

    • (Current leading solution in the "Best-Practices" category).

    • This solution utilizes ES6's Template Literal & does not mutate the input Array.
      */

    function createPhoneNumber(numbers){
    let newNums = numbers.join('');
    return (${newNums.substring(0, 3)})
    + ' ' + newNums.substring(3, 6)
    + '-' + newNums.substring(6);
    };

  • Custom User Avatar

    funny... built a solution that improves on this solution, then I read thesse comments lol... Solution below.