You need to sign in or sign up before continuing.×
6 kyu
Custom concat() Array Method
157user2420289
Loading description...
Arrays
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Such solution should be invalidated
Node 12 should be enabled (Refer this and this for more info)
kata does not work
Preloaded code is broken.
Bumping the issue
Spelling mistake.
This sentence has bad wording and is hard to read. And because of this it's hard to realize that there may be multiple arguments.
I updated the description. Hopefully its more clear
No random tests.
Random tests have been added.
Description is in conflict with the tests as noted below :
Johan :
"Description still mentions flattening is extra. With respect to [].concat(), it isn't.
Also, [].concat() supports multiple arguments. This isn't specified or tested."
Doc :
"My solution modifies the original array (which Array.prototype.concat does not do), but this kata doesn't check for that."
I've updated the description with the MDN description for the method and added tests for multiple arguments and original array mutation.
Should this mutate the original array or make a new copy?
It should make a copy; I've updated the description for clarity on this point.
This comment has been hidden.
I've added tests to check for it; thanks!
This is not push. This is concat.
Thanks for the feedback! I updated the kata to reflect concat instead of push.
Description still mentions flattening is extra. With respect to
[].concat()
, it isn't.Also,
[].concat()
supports multiple arguments. This isn't specified or tested.It's been a while since I've checked on this kata (my first)...I've updated the description with the MDN description, added better tests and random tests, and added the requirement to support multiple arguments.