Ad
  • Custom User Avatar

    what does - - do in that code

    --str.split(/[aeiou]/i)
    
  • Custom User Avatar

    The right hand side of the || is only evaluated if the left hand side is zero (a falsy value). So the sorting prioritizes count (objects with higher count come first), and when both counts are equal, the next condition is used (alphabetical sorting, by src and then by char).

  • Custom User Avatar

    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.

  • Custom User Avatar

    What is '.toUpperCase() doing here? ( I know what it does but why are we using it here?)

  • Custom User Avatar

    Please don't spoil solutions.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    can somebody explain me, what exactly happening or we doing in the sort after || or after the OR part?

  • Custom User Avatar

    Well here Array is an object and Object.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 the Array.prototype object.

    Hope you get it?
    else do let me know, I will give you some examples!

    BTW CLEVER code!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks will try that :) , and are you still reading it or ?
    and how is your progress now?

  • Custom User Avatar

    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?

  • Custom User Avatar
  • Custom User Avatar

    how is this working?

  • Custom User Avatar

    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 ;)

  • Custom User Avatar
    var titanic = new Ship(15, 10);
    
    Taking into account that an average crew member on board adds 1.5 units to the draft, a ship that has a draft of more than 20 without crew is considered worthy to loot. Any ship weighing that much must have a lot of booty!
    

    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...