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
It certainly is possible!
In fact it should yield a far less convoluted solution. Just now I updated my solution to work through ES6 classes, once you've completed the Kata please do make sure to give it a look and feedback is appreciated!
Hey
jegan145
,So some resources I think you'll find really handy in order to solve this Kata would be:
Also, remember that
Values
can only callOperators
, andOperators
can only callValues
, meaning they can't be the same thing.First of all, sorry for the late reply, didn't get the notification that there was a comment made on this Kata.
For that, I'll give you a hint, what you are and what you can be reduced to is not necesarily the same in Javascript,
this
can know how to become 0 or 2, pay close attention to the example in which the FluentCalculator is treated as aNumber
.I'm sorry I couldn't get on in time to give you a hand with whatever problem you had, but, I'm glad you solved it!
Thanks for you observation! I could've sworn I had it updated. Now there it is, sorry for any inconvenience that could've caused.
Because
Array.prototype.forEach
checks things that I'd the user to check for himself, like making sure that the current item really belongs to the Array, or just looping for as long as the original length regardless if it was changed or whatnot in the body of the function.Does this answer your question?
I'm really glad to read that!
Thanks :D
By
I'll assume you mean something like this:
However this wouldn't work since Array's setter for length ensures you pass an int or a number casteable value.
I'm not quite sure I'm following what you propose.
Do you mean having a property in the prototype of array that should not be inside the result of filter? Test added, please check and confirm I actually handled what you proposed
Regarding the '00' one, added. Please take a look and let me know if I hit the nail on the head.
Great ideas! I added tests for
falsy
values instead of just forundefined
.Had to refactor my solution a bit for the second suggestion, but it sure was a good catch.
Thanks for you comments, any other idea you might have, please do let me know. :D
This comment is hidden because it contains spoiler information about the solution
That's a great observation!
Test Case added!
Thanks for your comment.
Regarding the 1) Checked.
Regarding the 2) I'm sorry, I didn't update the Example Test Cases accordingly to changes I did to the Test Cases.
Please do take a look and let me know if I missed anything or if there's anything else you'd like to see changed.
Thanks for your comment!
Loading more items...