<html>
<body>
<h2>JavaScript 字符串</h2>
<p>检查以 "world" 结尾的字符串的前 11 个字符:</p>
<p id="demo"></p>
<p>Internet Explorer 不支持endsWith() 方法。</p>
<script>
let text = "Hello world, welcome to the universe.";
document.getElementById("demo").innerHTML = text.endsWith("world", 11);
</script>
</body>
</html>