Funny memories of the functional programming lessons many years ago. You discovered the killer app for this language from the type-less hell!
In your introduction to the U combinator, I stumbled over the expression sum(sum)(array.slice(1)), where sum(sum) looks pretty senseless. But of cause this is just
U(sum), which would better express the intended recursiveness of the function:
U(sum => array => … array + U(sum)(array.slice(1)))(…)