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.
Thank you so much for this comment! I was utterly confused when:
I would've never been able to guess a non-integer was the problem based on the information made available to me by the test. Bad form.
I would add more descriptive test cases result messages. I lost 20min not understanding the 4.5 case, test result description 'should return -1' I just didn't know what was the problem, wrong input should return empty array as it is written in the kata task. Message should tell me the test case and valid solution imho. for example 'Wrong result, 4.5 should return: []' instead of plain 'should return -1'. In JS there is only 'number' type not int or float. Had to add this specific check.
YI have spent a night thinking of it and you are totally right, I'll check if there is a way to implement TS type checking in tests. I'll start with translating other katas to TS and then redo this one, thank you. Ommiting types with any shouldn't be allowed.
(I see you actually made your solution generic. It should have been enforced in the tests. Not actually sure it's possible... but if it is, that has to be part of the specificiations, loud and clear, otherwise the code won't compile until it's complient, meaning the user won't have any proper feedback until he actually pass the kata. Which is a bad UX)
Hi,
any
for the values is just.... bad? The first interest in using type is... types values! => the class should be genericcheers
PS: I doubt implementing other data kinds will be more interesting. What you could do on the other hand is translate existing kata about all this in TS, rather than create new ones in TS only.
maybe doubly linked list hasn't been done before, you could check and perhaps make a series about that instead
Searching for "linked list" yields 26 results, and these are only the katas which mention it in the title. I'm pretty sure something as basic as creating a linked list class has been done already, possibly multiple times.
Thnak you for feedack. Making a collection of creating Nodes, LinkedList and adding more methods/functionality to it would be a bad idea?
Declaring and assigning variables is not a novel or interesting kata idea.
I was thinking about the same solution, but on every iteration you calculate calcValue(max). So I left the idea behind. althou I was thinking about passing object with { bestWord, bestScore }, but yea.. it think it would complicate readabilty.
That's not an imporvement IMO. Best practices says to do what you suggest to ensure that it strongly equates or does not equate to that.
https://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons
Thanks, haven't thought about that.
Only improvement possible: use
!==
instead of!=
as both arguments are numbers.Realy nice kata. Enjoyed it and learned someting about my programing language of choice. From both kata and solutions. Recomend to get to know ord() and chr().