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.
bruh
Not a kata issue, your code does not comply to below
Winner of bad code competition )
I don't get why this is the best. They just changed words into char. Making the code harder to understand. Right?
Can't understand why some people voted this is best practice when it's the exact opposite. Unreadable code with a lot of bloating comments.
I'm still a beginner and know a lot about functions, objects, etc., But this gave a lot of confusion as to what the class was, static, etc. It definitely should not be on 8 kuy.
Or someone could just briefly explain what these things are. ( static, class )
My mind when the same direction with checking the first 3 items.
Just wanted to konw, here they want to use make function right? Then why the 'class' and 'static'! I mean what are those? I have seen some of them in Java but in Js? really?
I agree with (1), though you won't always be able to achieve it of course, but I think function should break when passed
( 5 )
, unless the specs specifically say to handle both([int])
and(int,int,..)
( which I would consider bad design ).I actually like strong, static typing better than everything JS allows.
The last argument in reduce is intentional - I like to isolate the scope and try to to operate with the things that are not in the scope. Just a general rule.
And we both didnt consider that would happen if first function call would be on a single value, not an array.
like
difference(5)
should probably return 5, same asdifference([5])
.Function should not break.
But yeah, I agree, there is a room for improvement. Thanks.
You are right - there is no need to using spread syntax in this case.
It is just a habit (to create new arrays or object with optional keys without mutations).
Regarding all the logic in params - this is the dirty way to create variables.
Is there any particular reason you're writing all the logic in the parameter's field?
Also this expression
[...(p[c] ? [p[c][0]] : [i]), i]
couldn't it be written as[p[c] ? p[c][0] : i, i]
, or am I missing something?Anyway thank you for your solution, I learned a lot from it.
That's not a valid solution. You're doing a completely different thing from what is asked.
best
creative!
Loading more items...