namespace SimpleTextBreaking { function lineBreak ( text , lineLength ) { let lines = [ ] ; while ( text . length > lineLength ) { lines . push ( text . substr ( 0 , lineLength ) ) ; text = text . substr ( lineLength ) ; } lines . push ( text ) ; return lines ; } console . log ( lineBreak ( "Testing, testing" , 5 ) ) ; console . log ( lineBreak ( "..👮‍♀️" , 5 ) ) ; console . log ( lineBreak ( "...👮‍♀️" , 5 ) ) ; console . log ( lineBreak ( "....👮‍♀️" , 5 ) ) ; }