<html>
<body>
<h1>JavaScript Function bind()</h1>
<p>此例将尝试在 3 秒后显示人名。</p>
<p id="demo"></p>
<script>
const person = {
firstName:"Bill",
lastName: "Gates",
display: function() {
let x = document.getElementById("demo");
x.innerHTML = this.firstName + " " + this.lastName;
}
}
setTimeout(person.display, 3000);
</script>
</body>
</html>