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!
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 a Number.
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.
I'm not quite sure I'm following what you propose.
Enumerable numeric keys in Array.prototype (large enough so that they are not overriden in the array itself): Array.prototype['42'] = 42
Enumerable numeric keys in Array.prototype (less than the array length but missing in the array itself): Array.prototype['3'] = 42, a = new Array(10) However, I'm not sure if the behavior in this case is standardized or implementation-defined.
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 for undefined.
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
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...