JavaScript remove spaces from beginning and end of string with trim

preview_player
Показать описание
Key Points:
Removes leading and trailing spaces.
Does not modify spaces inside the string.
Returns a new string without the extra spaces (it does not modify the original string, since strings in JavaScript are immutable).
Does not remove non-breaking spaces ( ) or other special Unicode spaces; however, it does remove regular spaces, tabs, and line breaks.
Рекомендации по теме
join shbcf.ru