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
Javascript's initial code:
The function is
createPhoneNumber
and its argument isnumbers
. If you do something like this:It doesn't matter if you call your function like this:
createPhoneNumber([1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
the answer will be"(123) 456-7890"
instead of"(111) 111-1111"
. And that's what's wrong with your code.There is no issue with the tests, your code isn't using the function's argument, so, no matter which value you call your function with, the answer will be the same.