Functions vs methods

What is the difference between functions and methods?


A function is a function that is referenced by name. It can be passed between functions. It can be passed data to operate on and is not necessarily tied to an object.


A method is a special type of function that is only able to operate on data held within it’s class. It cannot be referenced individually, it can only be called via it’s class.