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.
This is so smart!
Amazing, really improved my understanding of the possibilities of reduce!
Good job, applause!
wonderful!
its amazing!!!
I had some fun after that comment. ;)
Kucharskimaciej your comment above is incorrect.
+v
is not an equivalent ofparseInt(v, 10)
. It is, in fact, an equivalent ofNumber(v)
. The '+' operator is a shorthand to coerce each 'v' from a string to a number.This might seem like splitting hairs, but it’s a critical point for others to understand this shorthand in a broader context.
In the solution above, we see that 'int' is already coerced into a number because of the
*256
. If we step through the first loop of the reduce method without coercing 'v', we can see how the sum would change —128 * 256 + "32" // "3276832" (INCORRECT)
vs128 * 256 + 32 // 32800 (CORRECT)
. Without coercing 'v' you actually coerce 'int' back into a string and concatenate 'v'I adore you.
This is so crazy and magic that I haven't seen before
This comment is hidden because it contains spoiler information about the solution
awesome!
This is the coolest solution i have seen so far on codewars.
+v
is an equivalent ofparseInt(v, 10)
I guess I'm a rebel then! :)
it wasn't at the begining
The morse code library is provided to you! No need to hardcode all morse code key values!
Loading more items...