Higher order functions - Javascript
I am working through Eloquent Javascript. The function count takes an array and a test function ( equals(x) ) as arguments, and returns the amount of elements in the array for which the test function returned true. I understand the broad way that these functions are working, and that logically the total argument to the anonymous function passed to reduce has a value of zero. Can someone help me to see where the value for total is coming from specifically though? I want to have a clearer picture in my mind. function count(test, array) { return reduce(function(total, element) { // Where is the