Trim whitespace from js