Morgan Stanley interview question

Javascript filter, map, reduce functions