Actually that doesn't work correctly in FF or Safari on OS X. It still has several empty strings filling up the array. They become more evident if you do this:
which gives you "||||four|three|two|||one||"." one two three four ".split(/ /).reverse().join("|")
In reply to Re^3: Five Ways to Reverse a String of Words (C#, Perl 5, Perl6, Ruby, Haskell)
by stvn
in thread Five Ways to Reverse a String of Words (C#, Perl 5, Perl 6, Ruby, Haskell)
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |