ThousandEyes interview question

reduce a tree (using array.prototype.reduce)