x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h1>JavaScript String trimEnd()</h1>
6
<script>
7
    var str = "    WebTutor     ";
8
    var result = str.trimEnd();
9
    document.write("Length String = " + str.length + "<br>Length Result = " + result.length);
10
</script>
11
12
</body>
13
</html>