I just started reading JavaScript and JQuery by John Duckett, and I really enjoy the book so far. In the book, I'm at the part where functions are introduced, and I'm kind of lost. What are some cool things I can do with simple object literal functions. I get how to create a simple function, but the book never really gives other examples of what I can create with these functions. For example,
var hotel = {
name: "Quay",
rooms: 40,
booked: 25,
checkAvailability: function() {
return this.rooms - this.booked;
}
};
I try to branch out from that, but I keep drawing a blank on where I can take these functions. I'm a beginner with JavaScript, so I don't know too much about the language.