<!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; } } let display = person.display.bind(person); setTimeout(display, 3000); </script> </body> </html>