JavaScript String trim() method : The trim() method is used to trim the unwanted extra space from both sides (left and right). It returns the new string without having the white-space on both sides.
The trim() method of {{jsxref("String")}} values removes whitespace from both ends of this string and returns a new string, without modifying the original string. To return a new string with ...