JavaScript Strings

The trim() Method

trim() removes whitespace from both sides of a string: