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.
concat
is for array method, a simple+
would do the trick.total isn't an array here, .push() is only for arrays. total is a number which is zero, other positive numbers will add to total and later returning the sum
yh
OR u pass zero in case the empty array
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
total variable will hold the added values to return the whole operation back
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You've got the right idea, however you are returning a reversed array instead of a reversed integer.
Expected: 987654321, instead got: [9,8,7,6,5,4,3,2,1]
. What's good about JavaScript is that if you use join("") it will automatically cast the integers to a string in which you can cast back to an integer.Loading more items...