Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The Function.
- function JoinArray( array, delimit ){
- return array.reduce( function( prevData, nextData ){ return ( prevData + delimit + nextData ); } );
- }
- // TEST:-
- local testarray = ["A","quick","brown","little","fox"];
- print( JoinArray( testarray, " " ) );
- // OUTPUT:-
- // A quick brown little fox
Add Comment
Please, Sign In to add comment