No need to loop twice over the array. Always use reduce if there are chained methods going through arrays