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.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..."
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.
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 ;)
4913, not 4193.