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.
better description and more test cases are required
The description has many typos, and does not provide adequate explanation. Anyone who knows what JSON is will likely find this kata far too simple; given the difficulty level, it would be appropriate to explain JSON in the description, or at the very least, provide a link to an explanation. The single example is not enough.
This comment is hidden because it contains spoiler information about the solution
Not set up to have variable accesssed by function
The word 'easier' is misspelled.
Instructions are unclear.
Typos and capitalization errors in the description. Also Kata only really makes sense when you look at the test cases, so description should be more detailed.
The description should elaborate on what is required. Without test cases this would have been much more confusing.
The description suggests that one should create a JSON compatible object, but the tests only compare strings.
The initial solution doesn't reflect that you want to use
a.toJson
, e.g. change theObject
prototype.For basic tests you should use strings to compare, do not show the
JSON.stringify
function.If you would want to make this much harder, you can actually delete the
JSON
object while saving JSON.stringify in a hidden place, remember to deleterequire
andmodule.require
to prevent recovery of theJSON
object using therequire("vm")
module.You should also test that circular objects need to throw an error.
This kata's description makes no sense.
JSON is a string format: if you want the result to be JSON, it should be the same as calling
JSON.stringify
.There are no example tests, and the examples in the description make it look like you want a method that returns the original object.