Parameters or Arguments
There are no parameters or arguments for the trim() method.
The trim() approach returns a string with whitespace characters removed from the start and stop of the string.
The trim() method does not exchange the cost of the authentic string.
var totn_string = ' TechOnTheNet '; console.log(totn_string.trim());
In this example, we have declared a variable known as totn_string that is assigned the string value of ‘TechOnTheNet’. We have then invoked the trim() approach of the totn_string variable to cast off the whitespace characters from the start and stop of the string.
We have written the output of the trim() approach to the net browser console log, for demonstration purposes, to show what the trim() technique returns.
The following will be output to the web browser console log:
In this example, the trim() technique removed the whitespace characters from the start and quit of the string ‘ TechOnTheNet ‘ and back a string cost of ‘TechOnTheNet’.