NOTE: The test cases for this kata are broken, but for some reason CodeWars has locked them and I cannot edit them. Specifically, the returned function is not propertly testing that old values are remembered. If and when I can fix the problem, I will, but I don't see any way to do that due to the lock.
it means you returned an object instead of a function. if a constructor returns a non-primitive, this is what new evaluates to; and functions are not primitives
i disabled it as well, but i'm sure there are still many more ways to cheat. i mostly wanted to disable the most obvious ones and to upgrade the tests suite
eval = require = function doNotUseEvalOrRequire() {
IMHO let's not use double assignment even in the author-facing side as it's so rare an idiom / so anti-standard-style. Two separate assignments is much clearer.
For what it's worth, I was vaguely familiar with what combinators were before I started this kata so I ended up having to manually derive most of the combinators from scratch (although the derived answers I got were extremely ugly and took me 2 weeks total), yet I loved the experience cause it really helped me understand combinators properly.
check this out:
JavaScript's object-to-string conversion is messy ;-)
This comment is hidden because it contains spoiler information about the solution
of course, it for alignment only.
This comment is hidden because it contains spoiler information about the solution
Is this still relevant ?
it means you returned an object instead of a function. if a constructor returns a non-primitive, this is what
new
evaluates to; and functions are not primitivesThanks for the approval; I changed the assignments to use single-assignment form from the kata editor. Also disabled
Function
, which I had forgotteni disabled it as well, but i'm sure there are still many more ways to cheat. i mostly wanted to disable the most obvious ones and to upgrade the tests suite
invalidated
done
invalidated
It was approved by someone, however it seems you forgot one more thing to disable:
https://www.codewars.com/kata/reviews/558cd9c3a98f5f0da3000057/groups/652f2c058fb49d00018471c9
IMHO let's not use double assignment even in the author-facing side as it's so rare an idiom / so anti-standard-style. Two separate assignments is much clearer.
LGTM otherwise
JS fork
new
eval()
andrequire()
chai
For what it's worth, I was vaguely familiar with what combinators were before I started this kata so I ended up having to manually derive most of the combinators from scratch (although the derived answers I got were extremely ugly and took me 2 weeks total), yet I loved the experience cause it really helped me understand combinators properly.
Loading more items...