Interestingly, this is relevant to TypeScript version of the Kata and not relevant to its JavaScript version. Discovered it just now, after translating my JS solution to TS. In JS version I am mutating position. Mutating position in TS version results in random tests failure. After copying it to temp variable and using it, the test passed with the same logic.
For some reason after getting a correct answer, starting from the 2nd test case, the function loop_size is called again. Despite this fact the kata is solvable. I managed to override this probable bug by using global scope in addition to local.
probably relates to specific language(s). js works, tried just now
TypeScript, error on example tests execution:
because this
should be like
i.e. references are lacking slash before right angle bracket
after this edit code compiles and example tests pass
this should probably be corrected in main spec, because on attempt to run all tests the same error is returned
Interestingly, this is relevant to TypeScript version of the Kata and not relevant to its JavaScript version. Discovered it just now, after translating my JS solution to TS. In JS version I am mutating position. Mutating position in TS version results in random tests failure. After copying it to temp variable and using it, the test passed with the same logic.
For some reason after getting a correct answer, starting from the 2nd test case, the function
loop_size
is called again. Despite this fact the kata is solvable. I managed to override this probable bug by using global scope in addition to local.This comment is hidden because it contains spoiler information about the solution