What is the best way to refactor(ise) an array / array of objects ? I was thinking of using array.reduce, but could not figure out a solution.
for example, transform