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.
what does - - do in that code
The right hand side of the
||
is only evaluated if the left hand side is zero (a falsy value). So the sorting prioritizescount
(objects with higher count come first), and when bothcount
s are equal, the next condition is used (alphabetical sorting, bysrc
and then bychar
).The code in the rightmost brackets gets executed first, converting the input string to uppercase.
Then, this value is passed into the leftmost pair of brackets (through the use of an es6 arrow function), and compared against the reversed string.
What is '.toUpperCase() doing here? ( I know what it does but why are we using it here?)
Please don't spoil solutions.
This comment is hidden because it contains spoiler information about the solution
can somebody explain me, what exactly happening or we doing in the sort after
||
or after the OR part?Well here
Array
is an object andObject.assign
does what it's name tells us, it assigns or say inserts the given properties to the given object.As here we are assigning those
square, cube etc
properties to theArray.prototype
object.Hope you get it?
else do let me know, I will give you some examples!
BTW CLEVER code!
This comment is hidden because it contains spoiler information about the solution
Thanks will try that :) , and are you still reading it or ?
and how is your progress now?
what is happening from (.concat, '.concat() wil..................)
and why and how are we getting ' '(space) for the second argument whereas it should return some value(like e) here?
why does this work?
how is this working?
Before starting I did one wonderful thing, that is, started reading comments because I knew this will be really really confusing one, and thank god I did, I got motivated and I didn't even got a little anger all thanks to the people who were encouraging to not to give up, and yeah finally I was able to solve it, but still for you help here's a HINT:
HINT:
Try to find the source code of the given function, in that you will find the (answer) or (instructions to pass) or (in simple secret to open that box)...
you can search how to ..... and you will for sure eventually get to the answer, don't forget to appreciate the creator of this wonderful kata!
Thanks for this Amazing kata BTW ;)
Here 1.5 has no relation with the input values, such as 15(draft) and 10(crew) here, so It is kinda formula or a hardcoded value, which you have to use to find the real value of the crews and then removal of that value from total ships value(draft) gives you the required value, which can be used to determine whether to loot it or not?
Loading more items...