ThousandEyes interview question

Implement fold in javascript.