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.
The 0 is necessary if no args are passed. This is never the case for this challenge, but if we're going to overengineer it to work with args[n>0] we might as well cover the extra case.
The
, 0
starting value isn't required in thisreduce
Starting with the first value in the array is fine, here.Thanks, @colbydauph !
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
"An arrow function expression has a shorter syntax than a function expression and does not have its own this, arguments, super, or new.target..."
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Is there a way to do this with regex?
Oh, wow. I didn't even notice that bit. That makes complete sense.
Yeah. When this solution was written (2015-04-24T17:59:22.000Z, judging by the MongoDB ID in the link), there was only Node 0.10 or something like that on Codewars.
It's best to use "const" instead of "var" when defining a function.
Oh wow, this is fantastic!
great use of regex!
I like your use of ".filter"!
Sorry abou tnot cleaning this up before submitting it!
Every element of the sequence satisfies a condition that certain power (e.i. ANY) of the sum of its digits is equal to the number itself. Your calculations are correct but the test cases are fine as well ;)
Loading more items...