Your code is producing the error: TypeError: Cannot read property 'reduce' of undefined. What does that mean?
You are calling a method named reduce on an empty array.
You are calling a method named reduce on an object that does not exist.
You are calling a method named reduce on an object that's has a null value.
You are calling a method named reduce on an object that's declared but has no value.