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.
It will give you ['even', 'odd'][0] which means 'even' (the value of the first index of the array ) or ['even', 'odd'][1] which means 'odd' (the second value of the second index of the array).
Similar to myArray = ['a', 'b', 'c'], where myArray[0] = 'a', myArray[1] = 'b', myArray[2] = 'c'.
It's an array, the 0 and 1 are the indexes of this array, friend.
by [...]
Ok, I understand that but how is "even" or "odd" determined based on the reducer returning 0 or 1?
I understand that 0 is the first element of the even,odd array and 1 is the second element, but how is the value passed in? I apologize if my phrasing is poor, I'm trying to learn ES6 right now.
It will give you either
0
or1
.How exactly does this work ? I understand the reducer section, but how does this arrow function interact with ["even, odd"]?
This comment is hidden because it contains spoiler information about the solution