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.
I don't understand why this works. I first tried to do it my own way and I got a few errors. Then I tried this code and it says it's good, but if I test it for use cases my code failed, you still get the wrong answer but still pass the problem somehow.
My code failed for those 2, but your code wors fine even if still fails. Why?
console.log(createPhoneNumber(['(', 1, 2, 3, 4, ')', ' ', 5, 6, 7, '-', 8, 9, 0])); // ((12) 34)- 567
console.log(createPhoneNumber(['(', 1, 2, 3, 4, ')', ' ', 5, 6, 7, 8, 9, '-', 0])); // ((12) 34)- 567