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'm just curious as to why this isn't the "best practice" it's this the "best" way to break the code down?
Right!!
arrow
but does it stop being a function?
since it uses "const" and not "function"
hack
Clever. I didn't think about using hash table for keeping both indexes and watching for a duplicate. I used a
Set
for the latter.no longer passes , tests have changed
You are exactly correct.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Thanks!
I sometimes impose additional constraints on myself when doing katas inspired by the coderetreat events, when you code in pairs and write the same program from scratch multiple times, each time with different restrictions. Coderetreat events use Game of Life for their sessions.
This piece of code is a result of me imposing a constraint that I'll only use arrow functions consisting of one expression. It's not readable, but the idea was to learn by doing something differently, or taking what you would normally do to the extreme. In my case, doing this kata was one of the reasons that led me to a realization, that arrow functions in JavaScript are very overused by developers, and I myself started using them less often.
This comment is hidden because it contains spoiler information about the solution
because you provided a sorted array of strings to the test
That's not tested for ( as many other things are not tested for ).
There is a solution for that, but it's outside the scope of a legacy 8 kyu kata with limited testing.
This solution breaks encapsulation of the instance variable that the original code preserved.
Loading more items...