This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
Creating and using an object method.
A method is actually a function definition stored as a property value.
const person = { firstName: "John", lastName: "Doe", id: 5566, fullName: function() { return this.firstName + " " + this.lastName; } }; document.getElementById("demo").innerHTML = person.fullName();