namespace UsingMap { function map < T , U > ( items , func ) { let result = [ ] ; for ( const item of items ) { result . push ( func ( item ) ) ; } return result ; } let numbers = [ 1 , 2 , 3 , 4 , 5 ] ; let squares = map ( numbers , ( item ) => item * item ) ; let strings = [ "apple" , "orange" , "peach" ] ; let lengths = map ( strings , ( item ) => item . length ) ; }