function trim(s) {
return s.replace(/^\s*|\s*$/g, '');
}
and in CoffeeScript
trim = (s) ->
s.replace /^\s*|\s*$/g, ''
You can check Steven Levithan's collection of trim functions.
function trim(s) {
return s.replace(/^\s*|\s*$/g, '');
}
trim = (s) ->
s.replace /^\s*|\s*$/g, ''
git clone https://github.com/jashkenas/coffee-script.git
cd coffee-script
bin/cake build:full
bin/cake build:browser
or
MINIFY=false bin/cake build:browser
npm install uglify-js