Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Functions</h2> <p>The value of <b>this</b>, in an object method, is the owner object.</p> <p id="demo"></p> <script> const myObject = { firstName:"John", lastName: "Doe", fullName: function() { return this; } } document.getElementById("demo").innerHTML = myObject.fullName(); </script> </body> </html>