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.
I see now, that makes sense. Thank you very much
Return value of .forEach() is always undefined. This method returns nothing, just provide function once for each array element.
I am not a JS person so I might be wrong, but doesn't it create two, or even three arrays? IMO best practice would be to create just one array (the one which should be filled in). Where am I wrong?
Why hasn't this one been voted as best practice by everyone?
The best way to get yourself fired.
It's not about the language. Anonymous functions in JavaScript implicitly return whatever you put in them, and "the sum of 2 numbers" is equivalent to "the variable storing the result of summing 2 numbers". The same behavior is present in some other languages too (Python, Ruby etc.).
This comment is hidden because it contains spoiler information about the solution
works either way, welcome to js
Disclaimer: I am still noob with Javascript. Shouldn't be sum += x instead of sum + x?