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.
Interesting!
The select! mutates the hash.
Brilliant kata to get someone started with HOC's.
It might be useful to write a test against hard coding 110 straight into the HOC instead of reading the value from the second parameter passed to withPriceModel.
I enjoyed the atmosphere from the Code Dojo as well. Make sure you ping me again when you organise the next one ;)
This comment is hidden because it contains spoiler information about the solution
Good to know. Thanks!
This comment is hidden because it contains spoiler information about the solution
Console.log the input.
I have stuck in the few basic tests for this kata. All of the random tests are passed.
It will help me a lot if I would know what the 3-d and 9 basic tests are ?
This comment is hidden because it contains spoiler information about the solution
Thank you. I am just getting used with the site. Will try to respect the good practices in the future :)
Thank you. I put "p" and it worked like a charm.
Make sure that you are not treating 0 as positive. It is neither positive nor negative.
And, Don't forget mark your code as spoiler next time(I help you marked it once)
You need to
return
the array instead ofprinting
it. When you return a value, the value is able to be checked for equality. Whilst if you print or puts it, it just outputs it to the console and is harder to check if that is the correct answer. All Katas (programs) on this website work like this. Ruby will evaluate and return the last statement it has read, so you don't need to the reserved wordreturn
, instead you can just leave the variable name.Btw you can use 3 backticks (`) to format your code; read the docs and a markdown cheatsheet. Also, welcome to Codewars :).
I guess the reason may be that you modify the original array.
Loading more items...