<html>
<body>
<h2>JavaScript Functions</h2>
<p>This example creates an object with 3 properties (firstName, lastName, fullName).</p>
<p>The fullName property is a method:</p>
<p id="demo"></p>
<script>
var myObject = {
firstName:"John",
lastName: "Doe",
fullName: function() {
return this.firstName + " " + this.lastName;
}
}
x = myObject.fullName();
document.getElementById("demo").innerHTML = x;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_function_call_method by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 13:23:28 GMT -->
</html>