Ad
  • Custom User Avatar

    use the backtics
    for best practice

  • Custom User Avatar

    I had the same issue with my JS solution. I was missing a step.

  • Custom User Avatar

    The instructions cover this case, where the string length is already less than or equal to 3 characters:

    e.g. trim("He", 1) should return "H..."

    But not this case, where the act of trimming reduces the string length to less than/equal to 3 characters:

    e.g. trim("Elephant", 2) should return "El..."

    That part was not clear to me until the final test cases (the basic tests also didn't cover the case).

    I think the following statement could be clarified to indicate that the string length referred to is not just that of the original input, but also of the trimmed fragment:

    "If the string is smaller than or equal to 3 characters then the length of the dots is not added to the string length."