Closed drewed closed 4 years ago
Your regex /^\s+|\s+$/ will only trim whitespace at the beginning or the end of the string but not both. Is there a reason you're not using String.prototype.trim()?
/^\s+|\s+$/
Just an oversight!
Your regex
/^\s+|\s+$/
will only trim whitespace at the beginning or the end of the string but not both. Is there a reason you're not using String.prototype.trim()?