Ad
  • Custom User Avatar
  • Custom User Avatar

    Big random tests: if this in not a performance kata, array size up to 1000 is sufficient.

    Small random tests: array size should be smaller (e.g. 0–30). The idea is: if something goes wring, one can insert print statements in the main loop (e.g. current step, partial score, some internal var, ...) and follow follow the algorithm step by step to find the bug.

  • Custom User Avatar
    • Math.round(Math.random() * X) can be replaced with _.random from lodash.
    • The //code here comment is not needed in hidden tests.
    • I'm a JS noob so forgive me a potentially stupid question, but is it idiomatic for JS to use arrow functions as named functions? I usually considered the arrow functions to be a kind of lambdas, and whole point of lambdas is to be, well anonymous. Isn't it that storing a lambda in a named variable defeats the whole purpose of arrow functions? Is there anything wrong with function prizeCounter(hoops) { ... }?