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.
I'll agree that this was a good intro to
child_process
but not so much about Async.damn, I wanna start this one but it looks complex.
This Kata should be downvoted IMHO. It doesn't teach anything useful applied in production ready code or even good theoretical patterns.
My solution passes those. But fails one in the final run. (the first one)
This comment is hidden because it contains spoiler information about the solution
lol. :>
As others have pointed out, the "1 line" constraint could have been expressed or enforced differently. I assume the author wanted to enforce a single expression / ban iterative solutions.
ok that's really a good one. I dont know how readable it is but it's as compact as hell.
really? hardcoding all possible values?
you must be kidding me.
that would only work on modern browsers..
I think you should clarify a bit more whether edge cases should be checked or not - for example if someone doesn't insert a number and so on..
uhm, you're making a new Calculator variable and you set it equal to your constructor... it's supposed to be something like var myCalc = new Calculator(); and then you can call it as myCalc.add(1,2); and so on. Also on your divide function, you re checking both variables to see if they're zero. That's mathematically not correct. In a/b , a can be very well 0, the result will be zero.
In your examples, could you add an example (or point to a link) that shows both the test written and the source code that it is actually testing? This would help a bit people who haven't done testing at all...
I'm having trouble testing a method I made which is inside an object. Can I set as "result" the function call directly or do I have to cache it beforehand and set it as a variable?