Parameters or Arguments
There are no parameters or arguments for the trimEnd() method.
The trimEnd() approach returns a string with whitespace characters removed from the end of the string.
The trimEnd() approach does not change the fee of the authentic string. The trimEnd() technique can be aliased as the trimRight() method which additionally eliminates whitespace characters from the proper side or stop of the string.
var totn_string = ' TechOnTheNet '; console.log(totn_string.trimEnd());
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 trimEnd() method of the totn_string variable to get rid of the whitespace characters from the cease of the string.
We have written the output of the trimEnd() approach to the internet browser console log, for demonstration purposes, to exhibit what the trimEnd() method returns.
The following will be output to the internet browser console log:
In this example, the trimEnd() method removed the whitespace characters from the end of the string and back a string value of ‘ TechOnTheNet’.