In JavaScript you often create functions that are methods of your own objects. You are also perfectly free to have functions that are not methods.
Event handler functions are usually not method functions, for example. In Java, all functions must be methods of some object, and all variables must be properties of some object.
Leave a Reply
You must be logged in to post a comment.