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.
The tests don't tell us anything about where the error is.
Why Object.assign(this, {firstName}) is used here instead of this.firstName=firstName? I haven't seen this method mentioned in a JavaScript book.
upd: copies into an object... Genius!
I don't think this should be 8kyu; it is not difficult, but it is fairly more involved than most 8kyu katas I've seen.
Nice Kata!
Thank you. I didn't know that array prototype can be extended with custom methods. That's what confused me.
That's the point of this kata (at least for JS version): extend array functionality with a new method. It doesn't exist, but you can write your own functions that extend a prototype (Array).
I don't understand the point of your question.
What I meant was that I haven't seen a method called "remove_", but I know that there are methods that remove values from an array.
Do you know the whole JS documentation is available online? If I type
js re
into Google, the autocompletion immediately proposes meje remove element from array
...Does Array.prototype have a remove_ method in JS?
This comment is hidden because it contains spoiler information about the solution
The reduce method is well suited for stacking array elements with each other.
A good solution. However, if you count large and very large values, then the processor may freeze.