namespace PrintUsingIterator { function print < T > ( iterator ) { let result = iterator . next ( ) ; while ( ! result . done ) { console . log ( result . value ) ; result = iterator . next ( ) ; } } }