I just read Head First JavaScript book. In the last page, the writers say:
Have you considered that a method is just a property in an object that is set to an anonymous function expression?
Does that mean that the JavaScript interpreter creates an object and assigns an anonymous function to that property?
For example I write this code
function example(){
// some code goes here
}
But what really happened is the object literal has the example property which I can call just by its property name.
I’m really confused.