Chomp for JavaScript
20070731
In most programming languages, there exist certain simple and useful functions that people come to rely upon. From my days with Perl, chomp was one of those functions for me.
Given a string, chomp bit off all newline characters at the end of the string (and returned the number of newline characters it removed).