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.
.
should be used instead of,
From the description:
Your task to create a Deferred class which should have the following parameters
new constructor()
is calling a constructor creating an object but not a class. As long as the new ES6class
is not used, we should not say: "create a class"what is referred as "parameters" is (IMHO) more a field, member or function
a
return this
statement is used at the end of the dummy implementation. This is implicite if uses in conjunction withnew
and should (IMHO) not be added.Espacially the redo operations reads as it can only applied directly after an undo operation, specifically not after a redo itself.
Oh sorry, my fault. I missed that very line :/
Hi, cool kata. As some already mentioned, the
function.toString
method is not widely known. I know that something is possible due to the use of AngularJS. I think you should mention this as a hint.Additionally, the last test is a little bit mean. It is a kata for its own.
Aaand just one note to the description: I think it's a hash or object and not a JSON. JSON would look like
{"c": 3}
This is a quite short answer. As you can see I tried to achieve something similar to pattern matching. Additionally, I make use of the fact, that the result of an assignment is the assigned value.
This comment is hidden because it contains spoiler information about the solution
Thanks!
@OverZealous: a also used the
even
function in the example test fixture.Mh, that was just a hint to be more creative than using only the
id()
function. I added an additional testcase.@OverZealous: It is not unusual to have Stream implementations without any stepping functions and always using
n + 1
. A Stream is a kind of anArray
andstepping
is equivalent to the always increasing index. That's BTW the reason I added a default implementation for it.Absolutely, I wrote some convenience methods and defaults for easier testcases but forgot, that a possible solution will not contain these. -> I removed this requirements.
First, I will remove the useless
this
constraint. The reason why I not added the function as the part of the fixture is, that the space for it is already cluttered with the comments about the test fixture.Thanks for the feedback. I added the result as a comment... And I will move it up to 5kyu due to the
this
-thingyOk, take your time... :D
Be patient, this is my first kata...
This shows - again - that some key features are missing to make JS a real functional language.
Loading more items...