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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Let me help you, rem is the result of summation (rem + ( on - off ) ) with consideration that rem initially equals 0.
second parameter - passed to the reduce callback function here - will be an array of two numbers, so he used the destructuring assignment syntax to get each element in that array individually.
then he substract these two individual elements to get the rest of people in each busstop and sum all these substracts with reduce method.
Hope this helps.
This function accepts a string not numbers