polyfill for javascript .trim() on String