Using map function to iterate on arrays to generate elements - DATANALYTICS