代码示例:(标识:js_function_bind_2)
<!DOCTYPE html>
<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>
运行结果: