Added map solution to functional javascript