Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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);
};
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);
};
funny... built a solution that improves on this solution, then I read thesse comments lol... Solution below.