JavaScript doesn't seem to have a native trim()
method. How can I trim white spaces at the start and end of a string with JavaScript?
I know this question is ancient but now, Javascript actually does have a native .trim()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim