I run into a problem when trying to generate an object through Array.reduce function. This code will work without any issues in javascript. However in typescript I\'m not ab