Ad
  • Custom User Avatar

    Nice kata. A couple of weird caveats thrown in that don't add anything to the challenge. And broken formatting at the start.

  • Custom User Avatar
    • Description should be language-agnostic

    • Finally, as an additional constraint, your solution must contain no more than one for * loop, while loop, forEach, map, reduce, reduceRight, find, findIndex, filter, some, or every. Your code will be checked and an error will be thrown if it contains more than one of these.

      What is the point of such restrictions? You can might as well add Array to the tally... and if too, and it adds nothing to the original task

    • Input validation is artificial and adds nothing to the task. In fact, below does not make any sense...

      However, your implementation should explicitly throw an Error when n is a positive number with any non- zero digits after the decimal separator; negative numbers are OK:

    You could might as well just throw an Error for all non-integer inputs, and clamp negative ones up to 1, if you opt to keep the validation requirement. Otherwise, discard them all is the wiser choice.

  • Custom User Avatar

    Description formatting is broken.