<!DOCTYPE html>
<html>
<body>
<h1>JavaScript String trimEnd()</h1>
<script>
var str = " WebTutor ";
var result = str.trimEnd();
document.write("Length String = " + str.length + "<br>Length Result = " + result.length);
</script>
</body>
</html>