Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
what
You were mutating the input. Now it shouldn't matter anymore.
This Kata is broken. For the random test it says:
expected [ ... ] to deeply equal []
Language: JS
Tell us your language. Help us help you!
Insufficient data. Closing.
:D
wtf
Why does it say 'Value is not what was expected' with no explanation on the last test? What is expected there?
This test in the test fixture assumes that every key is already set in the typed object before any assignment, which is different from the default behaviour of object (obviously, keys that are not set yet will not appear in
Object.keys
). This behaviour is not mentioned anywhere, and probably should be changed.The value it returns is
b
, of course, but the reference it returns isa
. This matters ifa
is an object or a property of one.I can't tell you offhand why your solution isn't working; possibly the mechanism is different within a setter. But, frankly, I think that's your problem. If I knew, I would gladly tell you, but seeing as I don't, I'm not making your problem mine. Both Alex' and my solution handle this correctly, as far as I can see, so it's not impossible.
Not sure how this would be possible, I tried to return the expression itself but that doesn't work.
Also,
a = b
returnsb
and notundefined
, or am I missing something?Fixed the description.
a = b
should returna
( with its new value ) in JS. The reference solution doesn't seem to do this and I haven't checked if this is tested. Existing programs sometimes rely on this; it is not good practice to returnundefined
for this expression even if the side effect is handled correctly.Description still doesn't specify what the initial values in a new
typedObject
shall ( or can ) be.Loading more items...