Error: ((intermediate value) || []).filter is not a function