trim とは削除したい対象文字列の前後の空白を削除する機能を持っています。 また"空白"とは、スペースやタブ、改行などが対象となります。 基本的な構文は以下になります。
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.