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.
or u can save the calculations
Because sometimes we want to convert from one type to another.
Nope. Not sure why I included them to be honest, as I think the code is more readable without :-)
are brackets necessary?
"Input will always be a non-negative integer."
Not good when we got negative numners
breakChocolate(-81, -1)
If there were no rules on the input, then that's probably a good idea. However, the description of the kata clearly states that the input will always be a non-begative integer, so the extra defensive code is unnecessary in this situation.
This comment is hidden because it contains spoiler information about the solution
If n or m is 0 you don't even need the multiplication
I'm a little confused with this syntax why have a ?
You're doing the same calculation (n*m) twice no need, should just check if n or m === 0
I mean why we don't remove the == and change the === to == ?
It is the commonly used solution for many developers.
So why it is not the commonly used solution ?
It works a bit faster than ==.
Loading more items...