Parameters or Arguments
There are no parameters or arguments for the trim() method.
The trim() method returns a string with whitespace characters removed from the start and end of the string.
- The trim() method does not change the value of the original string.
var totn_string = ' datascienceanalysiss '; console.log(totn_string.trim());
In this model, we have proclaimed a variable called totn_string that is allocated the string estimation of ‘datascienceanalysiss’. We have then conjured the trim() technique for the totn_string variable to eliminate the whitespace characters from the beginning and end of the string.
We have composed the yield of the trim() technique to the web program reassure log, for exhibit purposes, to show what the trim() strategy returns.
The accompanying will be yield to the web program support log:
In this model, the trim() technique eliminated the whitespace characters from the beginning and end of the string ‘ datascienceanalysiss ‘ and restored a string estimation of ‘datascienceanalysiss’.