JavaScript String trim()
JavaScript String trim()
The trim() method is used to remove whitespace from both sides of a string. It will not have any effect on the original string.
Syntax:-
Its syntax is:- string.trim()
Return:-
Its return is:- a string with removed whitespace from both ends